AddLookupColumn
AddLookupColumn Function
Extend a table by looking up specified columns in a key-value list.
Syntax
AddLookupColumn(vector Keys, vector Values, scalar DefaultValue, table Table, scalar LookupColumn1, LookupColumn2, ...)
Arguments
| Argument | Description |
|---|---|
vector Keys | Column containing the keys from the lookup table. |
vector Values | Column containing the values from the lookup table. |
scalar DefaultValue | A default value. |
table Table | Table that needs to be extended. |
scalar LookupColumn1, LookupColumn2,... | Column names from the Table to lookup. |
Examples:
AddLookupColumn(array(25, 2), array("Foo", "Bar"), "Baz", select (array(3, 25, 4, 2) as X, array("A", "B", "C", "D") as Y), "X")
Add a column "LookedupX" containing the values that match the keys specified in column X.