Liquid Studio
Data Mapping / Data Mapper Functions / By Category / Misc / Lookup
In This Topic
    Lookup
    In This Topic

    Function Name
    Lookup
    Category
    Misc
    Icon
    Subtract
    Description
    Maps one set of values to another
    Inputs
    Value The value to be mapped
    Outputs
    Result The mapped value
    Properties
    None -

    Usage

    The lookup component replaces one value with another, so for example you may need to change ISO 2 letter country codes into ISO 3 letter country codes, or Currency names into currency characters etc.

    The Lookup components properties (right click on the lookup component and select the 'properties' menu item), allow the key to value mappings to be configured.

    Values can be added individually via the Add button or the entire mapping can be edited via the Import button (allows editing as a CSV formatted list).

     

    The only other options effect how the lookup behaves when an attempt is made to map a value that is not present in the keys. There are 3 options.

    Use key (Input) value

    The value returned for an input value that has no corresponding key value will be the input value itself.

    Use Default Value

    The value returned for an input value that has no corresponding key value will be a default value specified by in the field below.

    Raise Error

    If an input value has no corresponding key value, then a runtime error is raised and the transform stops.

    The Key Value must be unique, and error will be raised if duplicates exist.

     

    Examples

    The following examples assume the following mapping data values have been set up

    Key Value
    US USA
    GB GBR
    FR FRA
    DE DEU

    Example 1

    If Mapping Failures is set to 'Use Key (input) Value'.

    Value Result
    US USA
    AU AU
    FR FRA

    Example 2

    If Mapping Failures is set to 'Use Default' and the default value is set to '???'

    Value Result
    US USA
    AU ???
    FR FRA

    Example 3

    If Mapping Failures is set to 'Raise Error'

    Value Result
    US USA
    AU Runtime Error