Skip to content

Syntax

SyntaxMeaningExample
+Addition100 + 20
-Subtraction100 - 20
*Multiplication100 * 0.05
/Division100 / 4
(...)Grouping(100 + 20) * 0.05
Leading - or +Sign-100

Multiplication and division run before addition and subtraction. Operators of equal precedence run from left to right, so 100 / 5 * 2 is 40. Spaces and line breaks may separate tokens.

Dividing by zero with / raises an error. Use SAFE_DIV to return a missing value instead.

FormExampleValue
Decimal1250.501250.5
Leading point.050.05
Scientific notation1.25e31250

Use a period as the decimal separator. Do not use thousands separators, currency symbols, or percent signs.

Strings use single or double quotes: 'example_key' or "example_key".

Within a string argument, + joins strings. Numbers are not converted to text automatically.

EscapeCharacter
\nNewline
\rCarriage return
\tTab
\\Backslash
\' or \"Quote

Boolean arguments accept true, false, a Boolean reference such as a Boolean argument, or a Boolean-returning function. They may be parenthesized.

IIF(Args.UseGrowth, this.PrevY * 1.05, this.PrevY)

A reference is an entity followed by a dot-separated property path. Each identifier in the path starts with a letter or underscore and continues with letters, digits, or underscores. Display labels that contain spaces cannot be used as references.

ReferenceTypeValue
this.PrevYDecimalThe current line’s value in the previous year. Available when the expression is evaluated for a line.
Cur.<line path>DecimalA financial line’s value in the year being calculated.
PrevY.<line path>DecimalA financial line’s value in the previous year.
Cur.YearIntegerThe year being calculated.
PrevY.YearIntegerThe previous year.
Args.<key>Argument’s typeA scalar argument’s value, or a time-series argument’s value for the year being calculated.
AssumptionCurve.<key>DecimalThe curve’s value for the year being calculated, whatever year is passed to a surrounding function.
Def.<line path>StringThe key of a financial line, for use as the key argument of a lookup function.

Replace <line path> with the complete path from the editor, including any segment or statement components, for example Cur.BalanceSheet.Assets. Do not type the angle brackets. Segment-definition contexts may expose further line keys as strings.

SAFE_DIV(100, 4)
ROUND(SAFE_DIV(100, 3), 2)

Arguments are separated by commas, and calls can be nested. Each call must supply exactly the number of arguments in the function’s signature.

Function names may be written unqualified. The qualified form uses the Engine entity, as in Engine.SAFE_DIV(100, 4). Variable references always need their entity.

All arguments are evaluated before the function runs, including both branches of IIF and both inputs of COALESCE.

See Functions for the full list.

TypeUsed for
DecimalFinancial values, rates, and the result of the main expression
IntegerYears, period numbers, offsets, windows, and rounding precision
StringFinancial line keys and text arguments
BooleanConditions in IIF, IIF_INT, and IIF_STR

The main expression must produce a decimal.

Integer and decimal references are not converted into each other. An integer year such as Cur.Year can fill the year argument of Val, but cannot be added to a decimal financial value. Literals such as 2 take the type that their position expects. Integer arithmetic supports the same four operators, and integer division truncates toward zero.

A recognized reference may have no value for the requested period. A missing value is distinct from zero and generally propagates through arithmetic. COALESCE, NULLIF, and SAFE_DIV handle missing values explicitly.

The following are not supported:

  • Comparison operators: >, <, ==, !=
  • Logical operators: and, or, !
  • Exponentiation ^ and remainder %
  • Ternary expressions, assignments, and loops
  • Comments
  • Array literals
  • A literal null
ErrorWhat to check
Unknown variable or propertyThe full registered reference, including line path, argument key, curve key, and capitalization.
Wrong typeDecimals in financial arithmetic, integers for years and offsets, strings for keys, and Booleans for conditions.
Wrong argument countThe function signature, with arguments separated by commas.
Unexpected characterUnsupported symbols such as %, >, ^, currency symbols, or thousands separators.
Division by zeroUse SAFE_DIV if a zero denominator should produce a missing value.
Error in an unused conditional branchBoth branches are evaluated, so each must be valid on its own.
Missing resultThe requested period, the availability of previous values, and the function’s missing-value rules.