다음을 통해 공유


MDX Descendant Function

This example shows how to use Descendant function with Desc_Flag as self_before_after which means this will show all members at level - Subcategory_Category_Product. and to prove that we are getting correct result I am using Member Property - Level which shows Level Name to which Member Belongs

With
Member Measures.ProductStatus As [Product].[Status].Member_Key
Member Measures.Levela as [Product].[Product Categories].currentmember.level.name
SELECT descendants ([Product].[Product Categories].[Category].allmembers,[Product].[Product Categories].[Subcategory],self_before_after)
on 1 ,
{Measures.ProductStatus,Measures.Levela} on 0
FROM [Adventure Works]
where
[Product].[Status].[Current]

Added a where clause just to show members with Product.Status as Current

image

Browsed Cube - To cross check whether I am getting correct result for Descendant Function

image