HIER_DEPTH returns a number representing the level depth of either all members of a hierarchy or a particular member, where 0 is the top level. The hierarchy can be either level-based or value-based.
NUMBER
HIER_DEPTH ( [ member [WITHIN] ]
dimension | hierarchy)
member is a value of hierarchy whose depth is calculated. Otherwise, the depth of all members of the hierarchy are calculated.
dimension is the dimension whose members are used in the calculation.
hierarchy is a hierarchy of dimension. Otherwise, the default hierarchy is used.
The following example returns the depth of each member of the Calendar hierarchy.
HIER_DEPTH(GLOBAL.TIME.CALENDAR)
| Member | Depth |
|---|---|
| 2003 | 0 |
| Q3-03 | 1 |
| Jul-03 | 2 |
The next example returns the depth of a single member of the default Fiscal hierarchy.
HIER_DEPTH('Jul-03' WITHIN GLOBAL.TIME)
| Member | Depth |
|---|---|
| Jul-03 | 2 |
Copyright © 2003, 2007, Oracle. All rights reserved.