Difference between revisions of "Data Mapping"
From Lianjapedia
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
''Under construction'' | ''Under construction'' | ||
+ | |||
+ | ==See Also== | ||
+ | [[INDEX]], [[KEYLOOKUP()]], [[SQL SELECT]] | ||
+ | |||
+ | ==Example Data Mapping App== | ||
+ | |||
+ | example_datamapping | ||
[[{{ns:file}}:dm_example_datamappingApp.png|376px|thumb|left|link={{filepath:dm_example_datamappingApp.png}}|Example Data Mapping app: example_datamapping]] | [[{{ns:file}}:dm_example_datamappingApp.png|376px|thumb|left|link={{filepath:dm_example_datamappingApp.png}}|Example Data Mapping app: example_datamapping]] | ||
Line 17: | Line 24: | ||
select productname from products order by productname | select productname from products order by productname | ||
</code> | </code> | ||
+ | |||
+ | |||
Get data mapping: | Get data mapping: | ||
Line 22: | Line 31: | ||
keylookup("products", "productid", {}, productname) | keylookup("products", "productid", {}, productname) | ||
</code> | </code> | ||
+ | |||
+ | <pre> | ||
+ | KEYLOOKUP(<workarea | alias | table>, <"indextagname">, <keyExpr>, <valueExpr> [, <notfoundExpr>]) | ||
+ | </pre> | ||
+ | |||
+ | {| class="wikitable" width="100%" | ||
+ | !width="50%"|Argument | ||
+ | !width="50%"|Description | ||
+ | |- | ||
+ | |valign="top"|"products"||The name of the lookup table (in quotes). Alternatively, the alias name (in quotes) or workarea number (no quotes) can be specified if the lookup table is open. | ||
+ | |- | ||
+ | |valign="top"|"productid"||The name of the index tag (in quotes) for the lookup table to search. Index tags can be created using the [[INDEX|index on command]]. | ||
+ | |- | ||
+ | |valign="top"|{}||The key value expression to search for in the index. In this case, we are looking for the numeric value of the order_details.productid field in the current row of the Grid Section, so we can use '''{}'''. For a character value, quotes are required ''''{}''''. | ||
+ | |- | ||
+ | |valign="top"|productname||The value expression to return if the key value is found in the index. So, in this case, if the value of the current order_details.productid is found in the products table productid index, the products.productname value will be returned for the corresponding record. | ||
+ | |- | ||
+ | |valign="top"|||An optional 'not found' expression can also be specified. If the key value is not found in the index, this will be returned, e.g. "Product not found". | ||
+ | |} | ||
Set data mapping: | Set data mapping: |
Revision as of 09:53, 3 February 2015
Under construction
See Also
INDEX, KEYLOOKUP(), SQL SELECT
Example Data Mapping App
example_datamapping
Choices:
select productname from products order by productname
Get data mapping:
keylookup("products", "productid", {}, productname)
KEYLOOKUP(<workarea | alias | table>, <"indextagname">, <keyExpr>, <valueExpr> [, <notfoundExpr>])
Argument | Description |
---|---|
"products" | The name of the lookup table (in quotes). Alternatively, the alias name (in quotes) or workarea number (no quotes) can be specified if the lookup table is open. |
"productid" | The name of the index tag (in quotes) for the lookup table to search. Index tags can be created using the index on command. |
{} | The key value expression to search for in the index. In this case, we are looking for the numeric value of the order_details.productid field in the current row of the Grid Section, so we can use {}. For a character value, quotes are required '{}'. |
productname | The value expression to return if the key value is found in the index. So, in this case, if the value of the current order_details.productid is found in the products table productid index, the products.productname value will be returned for the corresponding record. |
valign="top" | An optional 'not found' expression can also be specified. If the key value is not found in the index, this will be returned, e.g. "Product not found". |
Set data mapping:
keylookup("products", "productname", "{}", productid)