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: Descendants
Category: Set
Description: The Descendants function returns a set of descendants of a supplied member at a specified level or distance.
Syntax: DESCENDANTS( «Member»[, «Level»[, «Desc_flags»]] )
DESCENDANTS( «Member»,«Distance»[, «Desc_flags»] )
Technet Link: MDX Descendants Function




The query below returns the descendants at the supplied City level for the Country member Germany.
 

SELECT
      {} ON COLUMNS,
      {DESCENDANTS([Geography].[Geography].[Country].[Germany], [Geography].[Geography].[City])} ON ROWS
FROM
      [Adventure Works]
 
 

 
The following query returns the descendants at the supplied City level (using the distance method) for the Country member Germany.
 

SELECT
      {} ON COLUMNS,
      {DESCENDANTS([Geography].[Geography].[Country].[Germany], 2)} ON ROWS
FROM
      [Adventure Works]
 
 

 
The following query returns the Country member Germany along with all of its descendants at all levels.
 

SELECT
      {} ON COLUMNS,
      {DESCENDANTS([Geography].[Geography].[Country].[Germany], 0, SELF_AND_AFTER)} ON ROWS
FROM
      [Adventure Works]
 
 

 
The query below returns the Country member Germany only.
 

SELECT
      {} ON COLUMNS,
      {DESCENDANTS([Geography].[Geography].[Country].[Germany], 0, SELF)} ON ROWS
FROM
      [Adventure Works]
 
 

 
 

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