Skip to content

dimension.elementCount ​

Returns the number of leaf elements in a dimension.

Parent elements aren't included. Each leaf is counted once, even if it's in more than one hierarchy, and orphans (leaves that aren't in any hierarchy) are counted.

js
dimension.elementCount(dimensionName)

Parameters ​

ParameterTypeDescription
dimensionNamestringThe dimension's name.

Returns ​

number

The number of leaf elements, or -1 when the dimension can't be found. Use dimension.size if you'd rather get 0.

Examples ​

js
const elementCount = dimension.elementCount("time");