Skip to content

hierarchy.rootElements ​

Returns the top-level elements of a hierarchy.

js
hierarchy.rootElements(dimension, hierarchy)

Parameters ​

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

Returns ​

string

The names of the top-level elements as a JSON string. Read it with JSON.parse(). Returns a message starting with "Error:" when the dimension or hierarchy can't be found.

Examples ​

js
const members = JSON.parse(hierarchy.rootElements("Account", "Profit and Loss"));