Skip to main content Skip to complementary content

Dollar-sign expansion using a variable

In the load script or a chart expression, use a variable in a dollar-sign expansion to:

  • Reference text

  • Reference a numeric value

Text variable

When using a variable for text replacement in the script or in an expression, the following syntax is used:

$(variablename)

$(variablename) expands to the value in the variable. If variablename does not exist, the expansion will result in an empty string.

Examples: Text variable load scripts

Example: Text variable chart expression

Numeric variable expansion

For numeric variable expansions, the following syntax is used:

(#variablename)

The expansion always yields a valid decimal-point representation of the numeric value of the variable, possibly with exponential notation (for very large or small numbers). If variablename does not exist or does not contain a numeric value, it will be expanded to 0 instead of NULL.

Examples: Numeric variable load scripts

Expanding variables referencing alternate states

The variable has only one value, and this is used in all alternate states. When you expand a variable the value is also the same, independent of where it is made, and the state of the object.

If the variable is a calculated variable, that is, the definition starts with an equals sign, the calculation is made in the default state, unless you specify an alternate state in the variable definition.

For example, if you have a state named MyState, and a variable named vMyVar:

vMyvar: =only({MyState}MyField)

The variable definition content, with an explicit reference to the alternate state name, determines in which state the variable content will be evaluated.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!