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
| Parameter | Type | Description |
|---|---|---|
dimension | string | The dimension's name or id. |
hierarchy | string | The hierarchy's name or id. |
member | string | The element's name. |
Returns
booleantrue 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
}