Skip to main content

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​

ArgumentDescription
vector KeysColumn containing the keys from the lookup table.
vector ValuesColumn containing the values from the lookup table.
scalar DefaultValueA default value.
table TableTable 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.