Export (0) Print
Expand All
Avg
IIf
Lag
Max
Min
Mtd
Qtd
Sum
Var
Wtd
Ytd
Expand Minimize

IsAncestor (MDX)

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Returns whether a specified member is an ancestor of another specified member.

IsAncestor(Member_Expression1, Member_Expression2) 

Member_Expression1

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

Member_Expression2

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

The IsAncestor function returns true if the first member specified is an ancestor of the second member specified. Otherwise, the function returns false.

Example

The following example returns true if [Date].[Fiscal].CurrentMember is an ancestor of January 2003:

WITH MEMBER MEASURES.ISANCESTORDEMO AS

IsAncestor([Date].[Fiscal].CurrentMember, [Date].[Fiscal].[Month].&[2003]&[1])

SELECT MEASURES.ISANCESTORDEMO ON 0,

[Date].[Fiscal].MEMBERS ON 1

FROM [Adventure Works]

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft