Using the TableLookup function

The TableLookup function generally provides you with the option of transferring values from one table of the data model to another. You can look up values once using a formula calculation. You can also keep values calculated this way up-to-date in formula attributes and formula matrices (Creating a user-defined attribute and Creating a matrix calculated from a formula). If you for instance make changes to the source table, the target values of the TableLookup are automatically updated.

The TableLookup function takes the following form:

TableLookup (NetObjectType Var, condition, result)

whereby

Network object type

any Visum network object, e.g. a POI category

Var

user-defined variable, which must begin with a letter

The variable is used within the condition or result to refer to attributes of objects in the source table.

Condition

any logical expression

The expression is evaluated as a truth value: true or false. As a rule, an attribute of the source table is compared with an attribute of the target table.

Result

any expression

For lookup, no aggregate functions are provided. If several matching allocations are found, the first match is evaluated. If no matching value is found in the table of the network object type, an empty value is returned. Filter conditions for the network object type are not taken into account.

Example

You want to define the mobility rate for a demand stratum HWH based on the zone type. Create a POI category and for each zone type, define the respective mobility rate. Use Multi-edit or the Edit attribute procedure to assign a value to the respective zone attribute using the following syntax:

TableLookup(POIOFCAT_1 PK, PK[NO]=[TYPENO], PK[MRate])

The PK variable is used in the condition and the result to access the attributes No and MRate of POI category 1. TypNo is the zone attribute that is compared with the No of the POI category.