ANCESTOR

ANCESTOR

This documentation is for Kyvos 2026.5.x. To view documentation for other Kyvos versions, click here.

This documentation is for Kyvos 2026.5.x. To view documentation for other Kyvos versions, click here.

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

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]

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

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. 2026. All rights reserved.