Developer Transformation Guide > Lookup Transformation > Lookup Condition
  

Lookup Condition

The Data Integration Service looks up data in the lookup source based on a lookup condition. When you configure a lookup condition in a Lookup transformation, you compare the value of one or more columns in the source data with values in the lookup source or cache.
For example, the source data contains an employee_number. The lookup source table contains employee_ID, first_name, and last_name. You configure the following lookup condition:
employee_ID = employee_number
For each employee_number, the Data Integration Service returns the employee_ID, last_name, and first_name column from the lookup source.
The Data Integration Service can return more than one row from the lookup source. You configure the following lookup condition:
employee_ID > employee_number
The Data Integration Service returns rows for all employee_ID numbers greater than the source employee number.

Null Values in a Data Object Lookup

When an input to the Lookup condition is NULL, a data object Lookup transformation returns a single row with null values for output-only ports, and values from input rows for pass-through ports.
For example, the following lookup condition performs a lookup on a data source that contains one or more rows where the value for employee_ID is NULL:
employee_ID = employee_number
In this example, you use a lookup table with the following data:
EMPLOYEE_ID
LAST_NAME
1294765
Hara
1356356
Carver
1407207
NULL
1570348
Draper
NULL
Limonov
You compare the following input values from your data source with the lookup table:
EMPLOYEE_NUMBER
---------------
1294765
1356356
1407207
1648246
NULL
In this example, the Lookup condition produces the following results:
1294765,Hara
1356356,Carver
1407207,NULL
NULL,NULL
NULL,NULL
The Lookup condition finds matches between EMPLOYEE_ID and EMPLOYEE_NUMBER for the first two rows. For the third row, the lookup source contains a row with a NULL value that does not participate in the lookup condition. It matches the lookup condition, and returns a result with the NULL value for the non-lookup column.
For the fourth and fifth rows, the Lookup condition does not find a match, and returns NULL for both values. For the fifth row, note that the Lookup condition does not find a match again, because NULL does not match anything, including NULL.

Configure the Lookup Condition

The Lookup condition is an expression that determines which rows to retrieve from the lookup source. Configure the lookup condition on the Lookup tab of the Properties view.
The following image shows a lookup condition to perform a lookup by customer number:
You can configure the following options on the Lookup tab:
Specify by
Choose Value to select the lookup column and input port names. Select Parameter to configure an expression parameter to define the lookup condition.
Lookup column
The column in the lookup source to match with a column from the input row. You can include multiple columns in the lookup condition.
Operator
The operator that determines the condition to search for between the lookup column and the input port. Operators include =, !=, >, < , >=, <=.
Input Port
The input port that contains the value to search for in the lookup source. You can compare more than one input port to ports in the lookup source.

Rules and Guidelines for Lookup Transformation Conditions

Certain rules and guidelines apply when you enter a condition for a Lookup transformation.
Consider the following rules and guidelines when you enter a condition for a Lookup transformation.