/
ANCESTORS

ANCESTORS

  • Ancestors of a specified member at a specified level

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]
  • Specified member at a specified distance from the member

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

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]

Related content

ANCESTOR
ANCESTOR
More like this
ALLMEMBERS
ALLMEMBERS
More like this
CHILDREN
CHILDREN
More like this
CURRENTMEMBER
CURRENTMEMBER
More like this
COUNT
More like this
ANCENDANTS
ANCENDANTS
More like this

Copyright Kyvos, Inc. All rights reserved.