ANCESTOR

ANCESTOR

  • Specified member at a specified level

Description:
This function is used to return the ancestor of a specified member at a specified level.

Syntax:
Ancestor(Member_Expression, Level_Expression)

Return Type:
MEMBER

Parameters:

Parameter

Description

Parameter

Description

Member_Expression

It is a valid MDX expression that returns a member.

Level_Expression

It is a valid MDX expression that returns a level..

Example

WITH MEMBER Measures.x AS [Measures].[Customer Count] / ( [Measures].[Order Count], Ancestor ( [Customer].[Geography].CurrentMember, [Customer].[Geography].[Country] ) ), FORMAT_STRING = '0%' SELECT {[Measures].[Customer Count], Measures.x} ON 0, { Descendants ( [Customer].[Geography].[Country].&[Australia], [Customer].[Geography].[State-Province], SELF ) } ON 1 FROM [AdventureWorksMF]
  • Specified member at a specified distance from the member

Description:
This function is used to return the ancestor of a specified member at a specified distance from the member.

Syntax:
Ancestor(Member_Expression, Distance)

Return Type:
MEMBER

Parameters:

Parameter

Description

Parameter

Description

Member_Expression

It is a valid MDX expression that returns a member.

Distance

It is a valid numeric expression that specifies the distance from the specified member.

Example

WITH MEMBER Measures.x AS [Measures].[Customer Count] / ( [Measures].[Order Count], Ancestor ( [Customer].[Geography].CurrentMember, 1 ) ), FORMAT_STRING = '0%' SELECT {[Measures].[Customer Count], Measures.x} ON 0, { Descendants ( [Customer].[Geography].[Country].&[Australia], [Customer].[Geography].[State-Province], SELF ) } ON 1 FROM [AdventureWorksMF]

Copyright Kyvos, Inc. 2025. All rights reserved.