LOOKUPVALUE Function

Retrieves a lookup value from a lookup table.

Restrictions: You can specify the LOOKUPVALUE function in action expressions only.
If an expression contains the LOOKUPVALUE function, then the expression cannot contain anything else.
Returned data type: Lookup tables are stored as character data. However, you can assign the results of the LOOKUPVALUE function to a Character, an Integer, a Decimal, a Date, a Datetime, or a Boolean action term. The LOOKUPVALUE function converts the results to match the type of the action term.

Syntax

LOOKUPVALUE ('lookup_table_name', term_or_string)

Required Arguments

lookup_table_name

specifies the name of the lookup table that you want to search.

term_or_string

specifies the lookup key for the value that you want to retrieve. Enclose character strings in quotation marks.

Example

Suppose you have a Country_Codes lookup table that uses two-letter abbreviations for countries as the lookup key and country names as the lookup values. The Country_Codes lookup table contains the lookup key CA, and the lookup value that corresponds to that key is Canada.
Country_Codes lookup table showing lookup key CA with lookup value Canada
If the Ctry_Key column in the current input record contains the value CA, you can retrieve the lookup value that is associated with that key from the table Country_Codes with the following expression:
LOOKUPVALUE('Country_Codes',Ctry_Key)
If this expression is entered for the Country_Name action term, the expression assigns the value Canada to the term Country_Name.
Example LOOKUPVALUE('Country_Codes', Ctry_key) for action term Country_Name
Last updated: February 22, 2017