Go to primary content
Previous
Previous
 
Next
Next

Ancestor at Level (Text)

Returns the ancestor of the current dimension member at a specified level in the dimension hierarchy.

Template

Ancestor of the current member of the dimension dimension hierarchy hierarchy at level level.

Example

This calculated measure returns the name of each customer's region

Calculation

Ancestor of the current member of the CUSTOMER dimension CUSTOMER.SHIPMENTS hierarchy at CUSTOMER.SHIPMENTS.REGION level.

OLAP Expression Syntax

HIER_ANCESTOR(WITHIN CUSTOMER.SHIPMENTS LEVEL CUSTOMER.SHIPMENTS.REGION)

Query Results

The Ancestor column shows the Customer's region. Customer values that are not in the Shipments hierarchy, such as BAVARIAN IND, do not have a value.

Customer             Ancestor            
-------------------- -------------------- 
AMER                 AMER                 
APAC                 APAC                 
AUS                  APAC                 
BAVARIAN IND                              
BAVARIAN IND BON     EMEA                 
BAVARIAN IND IRV     AMER                 
BAVARIAN IND LON     EMEA                 
BAVARIAN IND MUN     EMEA