Skip to content

hierarchy.parentCount ​

Returns the number of immediate parents an element has in a hierarchy.

js
hierarchy.parentCount(dimension, hierarchy, element)

Parameters ​

ParameterTypeDescription
dimensionstringThe dimension's name or id.
hierarchystringThe hierarchy's name or id.
elementstringThe element's name.

Returns ​

number

The number of parents, or -1 when the dimension, hierarchy or element can't be found.

Examples ​

js
const count = hierarchy.parentCount("Account", "Management Profit and Loss", "EBIT");