LOOKUP
Description
The LOOKUP
operator allows you to lookup matching rows of a source column to a target table ignoring the potentially pre-defined join relationship in the Data Model.
LOOKUP
performs a left outer join between a target table and a source column which must have a N:1 relationship. Only equi-joins are supported. Multiple join conditions are combined using AND logic.
Syntax
LOOKUP ( target_table, source_column, (join_condition) [, (join_condition),... ] )
target_table: Table to which the source should be joined. The target_table is on the N-side of the join.
source_column: Column to be joined to the target_table. The table of source_column is on the 1-side of the join. This cannot be a constant.
join_condition: At least one join condition must be provided. If multiple join conditions are provided, these are combined using AND logic. See below for the syntax.
The join_condition consists of columns from the target_table and the source_table where source_table is the table that source_column belongs to:
(target_table.column, source_table.column)
target_table.column: A column from the target_table.
source_table.column: A column from the source_table.
A single join_condition may be interpreted as target_table.column = source_table.column
and multiple join conditions as target_table.col1 = source_table.col1 AND target_table.col2 = source_table.col2
.
Filter behavior
LOOKUP
does not change how filters propagate. Filters are applied on the LOOKUP result column as if was any other column on the target table.
Examples
[1]
| |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
|
[2] We can customize the join condition, e.g. by selecting only a specific ID, as long as the common tables of the join expressions match the respective | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
|
[3]
| |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
|
[4] A join can also be defined over multiple expressions or columns, even with multiple types. In this example our join consists out of two ID columns which are logically | ||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||
|
[5]
![]() In this context, the nodes of the graph may only converge, never diverge, otherwise we break the | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
|