Skip to content

hierarchy.childByIndex ​

Returns the name of a child of a parent element.

js
hierarchy.childByIndex(dimension, hierarchy, element, index)

Parameters ​

ParameterTypeDescription
dimensionstringThe dimension's name or id.
hierarchystringThe hierarchy's name or id.
elementstringThe parent element's name.
indexnumberThe child's position under the parent, starting at 0.

Returns ​

string

The child's name, or a message starting with "Error:" when there's no child at that position or the dimension or hierarchy can't be found.

Examples ​

js
const child = hierarchy.childByIndex("Account", "Management Profit and Loss", "EBIT", 0);

child is the name of the first child of EBIT in the Management Profit and Loss hierarchy.