Variable Functions

When a calculated attribute becomes too large to easily modify, you can use one or more variables to separate out parts of it, making it easier to test and manage. Variables allow you to calculate portions of the overall calculation individually, so that it becomes easier to read and maintain. See the use cases below.

A variable is declared within a calculated attribute using a label to identify the purpose, the text ':=', and then the necessary function(s), for example: [label] := [function]

Multiple variable declarations are added before a function call as a comma-separated list in curly brackets {}. The scope of the variables declared are only available inside the List function parameters that follow. (For more information, see the List Functions documentation here.) Variables can be reassigned to another value by normal expression 'var:=expr'. This expression evaluates to the value of 'expr' by assigning the value to variable 'var'.

Special Variable Functions

In addition to variables you create as described above, the following special variable functions are available for use within all ITERATE and FILTER function expressions: index, item, and size. These special variable functions can be typed into the Function Editor, or found by clicking the Insert Template button and navigating to Default Templates > All Functions > Special Variables.

Use Cases

For examples of these functions, see Variable Examples here.

For a scenario using the INDEX function, see Including Parent Info on Child Scenario here.

For a scenario using variables, see Overrides Scenario here.

For a scenario using the INDEX and ITEM functions, see Total Cost of Materials Scenario here.

2018, Stibo Systems