Lookup

Lookup(parameter1, parameter2, parameter3, parameter4)

Lookup can used to lookup values of an attribute from asset classes using another known value in the same asset class (like a basic SQL select query). Currently Lookup can be used inside a 'value' function only during post processing.

param 1 - This parameter is asset class name ex: $class.class name

param 2 - This parameter is the target attribute name (the attribute being looked up) ex:
$attribute.attribute name

param 3 (optional) - This parameter is the source attribute name (the attribute being used as a lookup key) ex:
$attribute.attribute name

param 4 (optional) -

This parameter is the source attribute value (value of the attribute being used as a lookup key).
It can be a fixed numeric or text value ex: 34 or some fixed value
It can also be a formula that computes a value. See Formula section for more details. ex: [$attribute.attribute name]

Lets consider an example lookup table (asset class in EMT)

Table XYZ = param 1

Column A (param 3)Column B (param 2)
1 Text Value 1
2 Text Value 2
3 Text Value 3

SQL: select [B] from [XYZ] where [A]=[2] = Text Value 2
Lookup($class.XYZ, $attribute.B, $attribute.A, 2) = Text Value 2

SQL: select distinct[B] from [XYZ] = Text Value 1, Text Value 2, Text Value 3
Lookup($class.XYZ, $attribute.B) = Text Value 1, Text Value 2, Text Value 3

Use Lookup with 'value' function

Output from Lookup can be used as the first parameter of value function. This enables triggering the lookup as desired and setting the looked up value in the desired asset class and attribute.

Example: In addition to above table XYZ, lets consider cross table lookups

Table MUGS

Column A (param 3)Column B (param 2)A1Lookup name
id1 text11 Text Value 1
id2 text22 Text Value 2
id3 text33 Text Value 3
id4 text44 Text Value 4

SQL: select [Column B] from [XYZ] where [Column A]=[Mugs.A1]
value(Lookup($class.XYZ, $attribute.B, $attribute.A, [$class.MUGS.$attribute.A1]), $attribute.Lookup name, UPDATE)