Skip to content

hierarchy.descendants ​

Returns the leaf elements below a parent element in a hierarchy, at every level. Parent elements along the way aren't included.

js
hierarchy.descendants(dimension, hierarchy, parent)

Parameters ​

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

Returns ​

string | null

The names of the leaf elements as a JSON string. Read it with JSON.parse(). A leaf that sits under more than one branch is listed once for each. Returns null when the dimension, hierarchy or element can't be found.

Examples ​

js
const elements = JSON.parse(hierarchy.descendants("Time", "Days Since Release", "Days Since Release"));