Skip to content

hierarchy.childByIndex

Returns the name of a child element of a parent element in a hierarchy.

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

Parameters

  • Dimension - The dimension in which the selected hierarchy exists.
  • Hierarchy - The identifier of the hierarchy to search.
  • Element - The identifier of the parent element.
  • Index - A Zero-based index of the child to return. (Zero is the first child)

Example

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

The child variable will be the name of the first child of the element EBIT in the Management Profit and Loss Hierarchy.