Skip to main content
Version: I2022.3.0

Ancestor

Syntax

Ancestor(Member_Expression, Level_Expression)

Ancestor(Member_Expression, Distance)

Input Parameters

Member_Expression
A valid Multidimensional Expressions (MDX) expression that returns a member.

Level_Expression
A valid Multidimensional Expressions (MDX) expression that returns a level.

Distance
A valid numeric expression that specifies the distance from the specified member.

Return Value

A function that returns the ancestor of a specified member at a specified level or at a specified distance from the member.

Examples

Return the Sales Amount for the Product's currentMember's Category

(ANCESTOR([Product].[Product Categories].CurrentMember,[Product].[Product Categories].[Category]),[Measures].[Internet Sales Amount Local])

Return the Sales Amount for the Product's currentMember's first degree ancestor (aka "Parent")

(ANCESTOR([Product].[Product Categories].CurrentMember,1),[Measures].[Internet Sales Amount Local])