dbTalk Databases Forums  

On the Fly custom hierarchy through MDX

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss On the Fly custom hierarchy through MDX in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Prasad
 
Posts: n/a

Default 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.
AllYearQuarterYr_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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.