Home      Functions     Common Solutions      Contact     






MDX Functions:
 
MDX Functions

 
Common Solutions

Common Solutions
 
Resource Links

MDX Books
MDX Related Software
MDX Related Blogs
 
Other Links

Contact Us
 
Microsoft SQL Server Analysis Services Function Page
Function Name: IsAncestor
Category: Navigation
Description: The IsAncestor function returns true or false depending if a supplied member is an ancestor of another supplied member.
Syntax: ISANCESTOR( «Member1»,«Member2» )
Technet Link: MDX IsAncestor Function




The query below returns True for the member Bikes since it is an ancestor of Road-650 Black, 58. All other Category members are not ancestors for Road-650 Black, 58, therefore, the IsAncestor function returns False.
 
WITH
      MEMBER [Measures].[IsAnAncestor] AS
      ISANCESTOR([Product].[Product Categories].CurrentMember, [Product].[Product Categories].[Product].[Road-650 Black, 58])
SELECT
      {[Measures].[IsAnAncestor]} ON COLUMNS,
      {[Product].[Product Categories].[Category]} ON ROWS
FROM
      [Adventure Works]
 
 

 
The query below returns True for the member CY 2001 since it is an ancestor of September 2001. All other Calendar Years are not ancestors for September 2001, therefore, the IsAncestor function returns False.
 
WITH
      MEMBER [Measures].[TrueOrFalse] AS
      ISANCESTOR([Date].[Calendar].CurrentMember, [Date].[Calendar].[September 2001])
SELECT
      {[Measures].[TrueOrFalse]} ON COLUMNS,
      {[Date].[Calendar].[Calendar Year].Members} ON ROWS
FROM
      [Adventure Works]
 
 

 
 

 
Copyright 2008 by MDXpert.com.
 
Terms of Use                              Privacy Statement
 
Site Powered By - WinHost.Com