2.341.7.26.5 Function: Lookup

Applies to RDL 2010/01 and RDL 2016/01

Lookup functions (Lookup, LookupSet, and MultiLookup) provide the ability to take a value from the current scope and find a corresponding value or collection of values within a specified dataset. This is typically used in reports for converting codes into human-readable labels.

Function

Arguments

Type

Description

Lookup

Return

Variant

Lookup evaluates the Source expression for the current instance of the current scope.

It then finds the first row of data in the specified Dataset* for which the source value equals the Destination expression evaluated for that row.**

It returns the value of the Result expression evaluated for that row, or NULL if no matching row is found.

The Return data type is the same as the Result data type.

Source

Variant

Specifies the value to look up.

The Source expression result MUST match the data type of the Destination expression.

The expression MUST NOT reference lookup functions.***

Destination

Variant

Specifies the value to compare the Source expression to.

The Destination expression MUST NOT reference aggregate functions, report items, or lookup functions.

Result

Variant

The Result expression MUST NOT reference aggregate functions, report items, or lookup functions.

Dataset

String

Name of the dataset in which to evaluate the Destination expression and Result expression. MUST be a constant, not an expression.

* After Dataset filters have been applied.

** The comparison SHOULD use collation settings from the Dataset.

*** "Lookup functions" refers to all types of lookup functions (such as Lookup, LookupSet, and MultiLookup).