MDX Get Descendants of Named Set

99 Views Asked by At

I'm looking to return all leaf descendants of a named set in MDX.

The set contains the following members:

CREATE SET [Time].[Quarter].[ActiveBudget_Qtr] AS 
   '{[Time].[Default].&[2020Q3], [Time].[Default].&[2020Q4], 
     [Time].[Default].&[2021Q1], [Time].[Default].&[2021Q2]}'

I am trying to return the month (which are leaf) descendants of this set:

DESCENDANTS({[Time].[Default].[ActiveBudget_Qtr]}, , LEAVES)

However, this is not returning any members. Thoughts?

1

There are 1 best solutions below

0
On BEST ANSWER

A little bit convoluted but something like the following:

DESCENDANTS(
  INTERSECT( 
    [Time].[Quarter].[Quarter].MEMBERS
   ,[Time].[Quarter].[ActiveBudget_Qtr]
  )
,, LEAVES
)