Skip to content

hierarchy.hasMember ​

Checks whether an element exists in a hierarchy.

It finds leaf and consolidated elements in that hierarchy, but not elements that are only in other hierarchies or are orphaned. The match isn't case-sensitive. To check every hierarchy at once, use dimension.hasMember.

js
hierarchy.hasMember(dimension, hierarchy, member)

Parameters ​

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

Returns ​

boolean

true when the element is in the hierarchy, otherwise false, including when the dimension or hierarchy can't be found.

Examples ​

js
if (hierarchy.hasMember("Account", "Profit and Loss", "Operating Expenditure")) {
    // do something
}