Skip to content

hierarchy.offset ​

Returns the element a set number of positions before or after another element in a hierarchy.

js
hierarchy.offset(dimension, hierarchy, element, offset)

Parameters ​

ParameterTypeDescription
dimensionstringThe dimension's name or id.
hierarchystringThe hierarchy's name or id.
elementstringThe element to start from.
offsetnumberHow many positions to move. Positive moves forward and negative moves back.

Returns ​

string

The element's name, or a message starting with "Error:" when it can't be found or the offset goes past the start or end of the hierarchy.

Examples ​

js
const element = hierarchy.offset("Account", "Profit and Loss", "EBITDA", 2);