PY
Category: Compare periods
Overview
| Description | Shifts the input node Node one year into the future while retaining all other dimensions. Use this when you need last year’s values alongside current data for year-over-year comparisons. |
| Syntax | PY('Node') |
| Parameters | Node: Input node that is shifted, specified using the node name in single quotes (e.g. 'Profit') |
Examples
Shifting values by one year
Each value appears one year later in the result.
Input node: Profit
| Year | Value |
|---|---|
| 2025 | 35 |
| 2026 | 42 |
| 2027 | 47 |
Formula: PY('Profit')
| Year | → PY Result |
|---|---|
| 2026 | 35 |
| 2027 | 42 |
| 2028 | 47 |
Shifting values by two years (nested PY)
Nesting PY calls shifts values further into the future. Here, each value moves two years forward. Try SHIFT as an alternative with a custom offset.
Input node: Profit
| Year | Value |
|---|---|
| 2025 | 38 |
| 2026 | 45 |
| 2027 | 52 |
Formula: PY(PY('Profit'))
| Year | → PY Result |
|---|---|
| 2027 | 38 |
| 2028 | 45 |
| 2029 | 52 |
Related Functions
| Function | When to use instead |
|---|---|
| PQ | When you need the previous quarter instead of the previous year. |
| SHIFT | When you need a custom offset or want to shift along a specific time level. |
| YOY_ABS | When you need the absolute difference to the previous year, not just the shifted values. |