On the Fly custom hierarchy through MDX -
08-02-2006
, 03:43 PM
Hi,
I have a TIME dimension in the cube with the following hierarchy.
AllYearQuarterYr_Mo.
In the below MDX I am created a SET with just 2 months (200301 & 200302).
And then I want to create a MEMBER which is kind of parent of the 2 months
(on the fly custom hierarchy). I am not sure how to define ‘Total’ as the
parent of ‘200301’ & ‘200302’. With my limited MDX knowledge, I defined
‘Total’ as the Aggregate of the 2 months.
Now, When I run the MDX, I get the count: 'defined as the descendants of the
current member at the Yr_Mo level' for ‘Total’ as 0. I am expecting it be 2
since there are 2 months below it.
Here is the MDX statement.
with
Set [Time set] as
'{[Time].[Hierarchy].[Yr_Mo].&[200301],
[Time].[Hierarchy].[Yr_Mo].&[200302]}'
member [Time].[Hierarchy].[Total] as 'AGGREGATE([Time set])'
member [Measures].[Count] as
'count(Descendants([Time].CurrentMember,[Time].[Hierarchy].[Yr_Mo]))'
select
{[Time set],[Time].[Hierarchy].[Total]}on columns,
[Measures].[Count] on rows
from
[HR Model]
200301 200302 Total
Count 1 1 0
Please help correct the syntax.
Thanks,
Prasad. |