Reference Updated April 8, 2026

SHIFT

Category: Compare periods

Overview

The SHIFT function shifts the input node by a given offset amount on a specified level. The shift amount can be a constant number or a node that provides different offsets per entry.

Use this function when you need a custom offset on a specific level instead of a fixed previous-period helper or a rolling aggregation.

Syntax

SHIFT('Node', "LevelName", ShiftAmount)

SHIFT('Node', "LevelName", 'ShiftNode')

Example usage: SHIFT('Revenue', "Year", 1)

Parameters

ParameterDescriptionTypeRequired
NodeInput node that is shifted, specified in single quotes (e.g.'Profit')Node referenceYes
LevelThe level along which data is shifted, specified in double quotes (e.g."Year"). The input node must have data on this level.Level nameYes
ShiftAmount / ShiftNodeThe offset to shift by. Can be a constant number or a node reference.Number or Node referenceYes

Output Shape

AspectBehavior
DimensionalityPreserved (same levels as input)
ValuesRepositioned along the specified level by the offset amount
Row countMay decrease if shifted values fall outside the level bounds

Watch Out

  • A positive shift amount moves values to earlier periods. A negative value moves them to later periods. This is the opposite of what many users expect.
  • For non-time dimensions, shifting is only allowed on the lowest level in the hierarchy.
  • Shifting on linked (extended) levels is not supported.
  • When using a node as the shift amount, its levels must match the input node’s levels.
  • Only whole-number offset values are considered.

Examples

Shift on the Year dimension (positive vs. negative)

This example illustrates how the sign of the ShiftAmount controls direction.

Input node: Revenue

YearRevenue
2025100
2026120
2027140

Formula: SHIFT('Revenue', "Year", 1) (positive → shifts data backwards)

Year→ SHIFT Result
2024100
2025120
2026140

The 2025 value now appears in 2024. Each value has moved one year into the past.

Formula: SHIFT('Revenue', "Year", -1) (negative → shifts data forward)

Year→ SHIFT Result
2026100
2027120
2028140

The 2025 value now appears in 2026. Each value has moved one year into the future.

A positive ShiftAmount moves values to earlier periods. Use a negative value to project values into future periods.

Shift by a constant amount

This example shifts all values on the Contract Age level by the same constant offset.

Input node: Contracts

Contract AgeContracts
110
220
330

Formula: SHIFT('Contracts', "Contract Age", -1)

Contract Age→ SHIFT Result
1
210
320
430

Shift by values from another node

This example uses a second node to define different shift amounts for each contract type.

Input node: Contracts

Contract AgeContract TypeContracts
1A10
2B20
3C30

Input node: Shift Node

Contract TypeAmount
A-1
B-2
C-3

Formula: SHIFT('Contracts', "Contract Age", 'Shift Node')

Contract AgeContract Type→ SHIFT Result
2A10
4B20
6C30

Shift by offsets defined per level value

This example uses a shift node on the same level that is being shifted, so each contract age gets its own offset value.

Input node: Contracts

Contract AgeContract TypeContracts
1A10
2B20
3C30

Input node: Shift Node

Contract AgeAmount
11
21
31

Formula: SHIFT('Contracts', "Contract Age", 'Shift Node')

Contract AgeContract Type→ SHIFT Result
0A10
1B20
2C30

FunctionWhen to use instead
PYWhen you need a fixed one-year shift for year-over-year comparisons without a custom offset.
TIMELAGWhen an effect should appear gradually or with a delay across time periods.
MOVINGSUMWhen you want to aggregate values over a rolling window instead of moving them to different positions on a level.
Was this page helpful?