Oracle® OLAP Expression Syntax Reference Release 11.2 Part Number E23381-01 |
|
|
PDF · Mobi · ePub |
HIER_PARENT
returns the parent of either all dimension members in a hierarchy or a particular member. The hierarchy can be either level-based or value-based.
VARCHAR2
HIER_PARENT ( [member_expression] [WITHIN] {DIMENSION dimension_id | HIERARCHY hierarchy_id} )
OLAXS241member_expression
Identifies a single dimension member within the hierarchy used for the calculation. If this optional argument is specified, then the result does not vary across dimension members.
OLAXS242dimension_id
The dimension over which the values are calculated using the default hierarchy.
OLAXS243hierarchy_id
The hierarchy over which the values are calculated. If dimension_id
is used instead, the default hierarchy is used.
This example returns the parents of all members of the default hierarchy of the Time dimension.
HIER_PARENT(DIMENSION GLOBAL.TIME)
Time | Parent |
---|---|
2006 | TOTAL |
Q1.06 | CY2006 |
Q2.06 | CY2006 |
Q3.06 | CY2006 |
Q4.06 | CY2006 |
JAN-06 | CY2006.Q1 |
FEB-06 | CY2006.Q1 |
MAR-06 | CY2006.Q1 |
APR-06 | CY2006.Q2 |
MAY-06 | CY2006.Q2 |
JUN-06 | CY2006.Q2 |
JUL-06 | CY2006.Q3 |
AUG-06 | CY2006.Q3 |
SEP-06 | CY2006.Q3 |
OCT-06 | CY2006.Q4 |
NOV-06 | CY2006.Q4 |
DEC-06 | CY2006.Q4 |
The next example returns EMEA
as the parent of Italy within the default hierarchy of the Customer dimension.
HIER_PARENT('ITA' WITHIN DIMENSION CUSTOMER)