BASELINE
- BASELINE(baseline, reference, fallback=None)[source]
Returns the value of a tracked field or named value at a captured baseline.
Until the baseline is captured at runtime, the function evaluates to blank (or to
fallbackif supplied). UseHASBASELINE()to guard against the not-yet-captured case.BASELINEdoes not create a dependency cycle with the live value, so a field may reference its own baseline.- Parameters:
baseline (
Baseline|str) – The baseline to read from, or its name.reference (
Field|Calculation|Parameter) – The tracked field or named value to read. Must be a single field or named-value reference — expressions are not supported (writeBASELINE(b, [a]) + BASELINE(b, [c])instead ofBASELINE(b, [a] + [c])).fallback (
Field|Calculation|Parameter|None) – Optional. A field or named value supplying the value to use before the baseline has been captured. Must sharereference’s data type.
- Return type:
- Returns:
The baselined value of
reference, with the same data type.- Raises:
TypeError – If
reference(orfallback) is not a field or named value — a baseline can only read a single tracked element, not an expression.ValueError – If
referenceis not assigned to any tracking group, or iffallbackhas a different data type toreference.
Examples
Delta since optimisation:
revenue - BASELINE("optimised", revenue)
With a fallback to the live value:
BASELINE("optimised", revenue, revenue)
``baseline`` — accepted types
STRING
``reference`` — accepted types
BOOLEAN
BOOLEAN_ARRAY
BOOLEAN_MAP
DATE
DATETIME
DATETIME_ARRAY
DATETIME_MAP
DATE_ARRAY
DATE_MAP
DECIMAL
DECIMAL_ARRAY
DECIMAL_MAP
INTEGER
INTEGER_ARRAY
INTEGER_MAP
NULL
OBJECT
OBJECT_ARRAY
STRING
STRING_ARRAY
STRING_MAP
TIME
TIME_ARRAY
TIME_MAP
``fallback`` (optional) — accepted types
BOOLEAN
BOOLEAN_ARRAY
BOOLEAN_MAP
DATE
DATETIME
DATETIME_ARRAY
DATETIME_MAP
DATE_ARRAY
DATE_MAP
DECIMAL
DECIMAL_ARRAY
DECIMAL_MAP
INTEGER
INTEGER_ARRAY
INTEGER_MAP
NULL
OBJECT
OBJECT_ARRAY
STRING
STRING_ARRAY
STRING_MAP
TIME
TIME_ARRAY
TIME_MAP
Return types
BOOLEAN
BOOLEAN_ARRAY
BOOLEAN_MAP
DATE
DATETIME
DATETIME_ARRAY
DATETIME_MAP
DATE_ARRAY
DATE_MAP
DECIMAL
DECIMAL_ARRAY
DECIMAL_MAP
INTEGER
INTEGER_ARRAY
INTEGER_MAP
OBJECT
OBJECT_ARRAY
STRING
STRING_ARRAY
STRING_MAP
TIME
TIME_ARRAY
TIME_MAP