YOY_ABS
YOY_ABS('Node' [, "MissingValueBehaviour"])
The YOY_ABS function returns the absolute growth for each year compared to the previous year (year-over-year). The result is the difference current_year - previous_year in the same unit as the input.
Use this function when you need the absolute difference between consecutive years: YOY_ABS('Revenue').
Parameters
- NodeNode referenceRequired
- Input node, specified using the node name in single quotes (e.g.
'Revenue') - MissingValueBehaviourKeywordOptional
- How missing values in the time series are treated. Default:
"IGNORE_MISSING"."IGNORE_MISSING": Missing rows are skipped. A result row is only produced where both the current year and the previous year have values. This is the default."MISSING_AS_ZERO": Missing rows are treated as 0.
Output shape
- Dimensionality
- Same as input.
- Time range
- With IGNORE_MISSING, the first year is dropped and years adjacent to gaps are also removed. With MISSING_AS_ZERO, every year where either current or previous has data is included.
- Values
- Each value is
current_year - previous_year. The result keeps the same unit as the input. - Row count
- Reduced with IGNORE_MISSING. With MISSING_AS_ZERO, can include years beyond the input data range (within the project horizon).
Watch out
- The input must have a Year level. If the input does not contain a Year level, the function fails.
- With MISSING_AS_ZERO, results appear at years where the input has no data. A missing current year treated as 0 produces a negative result equal to the previous year’s value. A missing previous year treated as 0 produces a positive result equal to the current year’s value.
- With MISSING_AS_ZERO, years beyond the input data range (but within the project horizon) may appear in the result.
Examples
Default: ignoring missing values
This example shows YOY_ABS with the default behavior.
Input node: 'Profit'
| Year | Value |
|---|---|
| 2025 | 200 |
| 2026 | 300 |
| 2027 | 450 |
| 2028 | 500 |
| 2030 | 100 |
Formula: YOY_ABS('Profit')
Equivalent to: YOY_ABS('Profit', "IGNORE_MISSING")
| Year | Calculation | Result |
|---|---|---|
| 2026 | 300 - 200 | 100 |
| 2027 | 450 - 300 | 150 |
| 2028 | 500 - 450 | 50 |
The first year (2025) has no previous year to compare against. The gap at 2029 causes both 2029 and 2030 to be excluded.
Treating missing values as zero
With MISSING_AS_ZERO, gaps are filled with 0, producing results for every year including those without input data.
Formula: YOY_ABS('Profit', "MISSING_AS_ZERO")
| Year | Calculation | Result |
|---|---|---|
| 2025 | 200 - 0 | 200 |
| 2026 | 300 - 200 | 100 |
| 2027 | 450 - 300 | 150 |
| 2028 | 500 - 450 | 50 |
| 2029 | 0 - 500 | -500 |
| 2030 | 100 - 0 | 100 |
| 2031 | 0 - 100 | -100 |
Year 2025 now has a result because its previous year (2024) is treated as 0. Year 2031 (beyond the input data but within the project horizon) also appears because 2030 has a value.