ANCESTORS

ANCESTORS

1. ANCESTORS (Syntax:Ancestor(Member_Expression, Level_Expression))

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

Syntax:
Ancestors(Member_Expression, Level_Expression)

Return Type:
SET

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].[Customer Count], Ancestors ( [Customer].[Geography].[Country].CurrentMember, [Customer].[Geography].[Country] ).Item (0) ), 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]

2. ANCESTORS (Syntax:Ancestor(Member_Expression, Distance))

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

Syntax:
Ancestors(Member_Expression, Distance)

Return Type:
SET

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

SELECT [Measures].[Customer Count] ON 0, { Ancestors( [Product].[Product Categories].[Category].&[Accessories],1 ) } ON 1 from [AdventureWorksMF]

Copyright Kyvos, Inc. 2026. All rights reserved.