HIER_LEVEL returns the level of either all members of a hierarchy or a particular member. The hierarchy must be level-based.
VARCHAR2
HIER_LEVEL ( [ member [WITHIN] ]
dimension | hierarchy)
member is a value of hierarchy whose level is calculated. Otherwise, the levels 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 level of each member of the Calendar hierarchy.
HIER_LEVEL(GLOBAL.TIME.CALENDAR)
| Member | Level |
|---|---|
| 2003 | CALENDAR_YEAR |
| Q3-03 | CALENDAR_QUARTER |
| Jul-03 | MONTH |
The next example returns the level of a single member in the default Fiscal hierarchy.
HIER_LEVEL('Jul-03' WITHIN GLOBAL.TIME)
| Member | Level |
|---|---|
| Jul-03 | MONTH |
Copyright © 2003, 2007, Oracle. All rights reserved.