Skip to main content
Skip table of contents

SHIFT

Basic Overview

Description

Shifts the input node by a given offset amount on any dimension.

Signature

SHIFT(Node, LevelName, ShiftAmount)

Parameters

  • Node: Input node that is shifted, specified using the node name in single quotes (e.g. 'Profit')
  • LevelName: Specifies the level in which the offset is described using the level name in double quotes (e.g. "Year"). The input node is required to have data on this level.

  • Amount: The offset to shift by. This parameter is joined with the Node parameter and will give the proper amount for each entry. This means that the amount cube must match with the levels on the Node parameter.
  • New in version 3.7: Amount can be a node.
  • New in version 3.9: Shifts on any dimension are allowed.

Example 1

Input Profit

Year

Profit

2015

35

2016

42

2017

47

Output SHIFT('Profit', "Year", -1)

Year

Profit

2015


2016

35

2017

42

2018

47

Example 2

Input Profit

YearProductProfit
2018Car50
2018Van25

Input Shift Node

ProductAmount
Car-1
Van-2

Output SHIFT('Profit', "Year", 'Shift Node')

YearProductProfit
2019Car50
2020Van25



Example 3


Available since: 3.7.0

Input Profit

YearProductProfit
2020Car100
2020Van200

2021

Car120
2021Van220
2022Car150
2022Van250

Input Shift Node

YearAmount
20200
20211
20222

Output SHIFT('Profit', "Year", 'Shift Node')

YearProductProfit
2020Car370
2020Van670


Example 4


Available since: 3.9.0

Dimension: Vehicle

Vehicle

CategoryBody Type
0CarCompact
1CarSedan
2VanTransporter
3TruckTrailer


Input Profit

YearBody TypeTax
2020Compact100
2020Transporter200

2020

Trailer1200

Input Shift Node

Body TypeAmount
Compact1
Transporter1
Trailer0

Output SHIFT('Profit', "Body Type", 'Shift Node')

YearBody TypeTax
2020Sedan200
2020Transporter1200


Example 1

Input Profit

Year

Profit

2015

35

2016

42

2017

47

Output SHIFT('Profit', "Year", -1)

Year

Profit

2015


2016

35

2017

42

2018

47

Example 2

Input Profit

Year
Product
Profit
2018Car50
2018Van25

Input Shift Node

Product
Amount
Car-1
Van-2

Output SHIFT('Profit', "Year", 'Shift Node')

Year
Product
Profit
2019Car50
2020Van

25

Example 3

AVAILABLE SINCE 3.7.0

Input Profit

Year
Product
Profit
2020Car100
2020Van200

2021

Car120
2021Van220
2022Car150
2022Van250

Input Shift Node

Year
Amount
20200
20211
20222

Output SHIFT('Profit', "Year", 'Shift Node')

Year
Product
Profit
2020Car370
2020Van670

Example 4

AVAILABLE SINCE 3.9.0

Dimension: Vehicle

Vehicle

CategoryBody Type
0CarCompact
1CarSedan
2VanTransporter
3TruckTrailer

Input Profit

Year
Body Type
Tax
2020Compact100
2020Transporter200

2020

Trailer1200

Input Shift Node

Body Type
Amount
Compact1
Transporter1
Trailer0

Output SHIFT('Profit', "Body Type", 'Shift Node')

Year
Body Type
Tax
2020Sedan200
2020Transporter1200
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.