Go to primary content
Previous
Previous
 
Next
Next

Hierarchy Depth

Returns the depth of each member in the specified dimension hierarchy. A null indicates that the member does not belong to the hierarchy.

Template

Hierarchy depth of the current member in dimension and hierarchy.

Example

This calculated measure returns the distance between the Customer dimension member and the topmost member (TOTAL).

Calculation

Hierarchy depth of the current member in CUSTOMER and CUSTOMER.SHIPMENTS.

OLAP Expression Syntax

HIER_DEPTH(CUSTOMER.SHIPMENTS)

Query Results

The Depth column shows the depth of the Customer members in the Shipments hierarchy.

Customer             Level                     Depth 
-------------------- -------------------- ---------- 
TOTAL                TOTAL                         0  
AMER                 REGION                        1  
APAC                 REGION                        1  
AUS                  WAREHOUSE                     2  
BAVARIAN IND         ACCOUNT                          
BAVARIAN IND BON     SHIP_TO                       3  
BAVARIAN IND IRV     SHIP_TO                       3  
BAVARIAN IND LON     SHIP_TO                       3  
BAVARIAN IND MUN     SHIP_TO                       3  
BAVARIAN IND ROM     SHIP_TO                       3