dbTalk Databases Forums  

Need help with MDX

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


Discuss Need help with MDX in the microsoft.public.sqlserver.olap forum.



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

Default Need help with MDX - 08-03-2006 , 02:00 PM






Hi,

As you can see, I created a calculated Measure called
[Mbr Count] = [Member Months] / Descendants ([Time].Current Member,
[Time].[Yr_Mo]) --- # of Months ----

Now i created a 'Time Set' with 2 months and defined a member 'Total' as an
Aggregate of the 2 months.

When i run the below MDX, i am getting "1.#INF" for the 'Total'. I know that
the Descendants function for 'Total' is giving 0 and hence the 1.#INF. I want
it to return 2 (for 200301 & 200302) so that i can get the calculated value
for 'Total'.

Please help with the MDX.


200301 200302 Total
---------- ----------- -----------
Mbr Count 11549106 11471022 1.#INF


with
MEMBER [Measures].[Mbr Count] as
'iif([Measures].[Member Months] <> 0,
[Measures].[Member Months] /
count(Descendants([Time].CurrentMember,[Time].[Hierarchy].[Yr_Mo])), 0)'

Set [Time set] as
'{[Time].[Hierarchy].[Yr_Mo].&[200301],
[Time].[Hierarchy].[Yr_Mo].&[200302]}'

member [Time].[Hierarchy].[Total] as 'AGGREGATE([Time set])'

select
{[Time set],[Time].[Hierarchy].[Total]}on columns,
[Measures].[Mbr Count] on rows
from [Sales Model]

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.