Ancestor

Analysis Services

Analysis Services

Ancestor

Returns the ancestor of a member at a specified level or distance.

Syntax
Level

Ancestor(«Member», «Level»)

Returns the ancestor of «Member» from the dimension level specified in «Level».

Distance

Ancestor(«Member», «Numeric Expression»)

Returns the ancestor of «Member» that is «Numeric Expression» steps away in the hierarchy.

Example

If the Geography dimension includes levels Country, State, and City, the following functions return the following values.

Expression Returns
Ancestor(Los Angeles, Country)
[USA]
Ancestor(Los Angeles, State)
[California]
Ancestor(Los Angeles, 0)
[Los Angeles]
Ancestor(Los Angeles, 1)
[California]
Ancestor(Los Angeles, 2)
[USA]