PY

PY('Node')

In Compare periods

The PY function shifts the input node one year into the future while retaining all other dimensions.

Use this function when you need last year’s values alongside current data for year-over-year comparisons.

Parameters

NodeNode referenceRequired
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'

YearValue
202535
202642
202747

Formula: PY('Profit')

YearPY Result
202635
202742
202847

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'

YearValue
202538
202645
202752

Formula: PY(PY('Profit'))

YearPY Result
202738
202845
202952

See also

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.
Was this page helpful?