YOY_ABS
Category: Compare periods
Overview
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.
Syntax
YOY_ABS('Node' [, "MissingValueBehaviour"])
Example usage: YOY_ABS('Revenue')
Parameters
| Parameter | Description | Type | Required | Default |
|---|---|---|---|---|
| Node | Input node, specified using the node name in single quotes (e.g.'Revenue') | Node reference | Yes | — |
| MissingValue Behaviour | How missing values in the time series are treated | Keyword | No | IGNORE_ MISSING |
MissingValueBehaviour options:
"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
| Aspect | Behavior |
|---|---|
| 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') = YOY_ABS('Profit', "IGNORE_MISSING")
| Year | → YOY_ABS 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 | → YOY_ABS 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.
Related Functions
| Function | When to use instead |
|---|---|
| YOY_REL | When you need the percentage change year-over-year instead of the absolute difference. |
| DELTA_ABS | When you need the absolute change along any dimension, not just time (e.g. compare across products). |
| CAGR | When you need compound growth over multiple periods, not just a single-period comparison. |