dbTalk Databases Forums  

Is this possible with dimension?

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


Discuss Is this possible with dimension? in the microsoft.public.sqlserver.olap forum.



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

Default Is this possible with dimension? - 03-14-2006 , 03:19 PM






I am new to new to MDX queries,
Here is my situation, I am using AS2000

Dimension :

Charge,Calander,.......

Chargable Account: All,Yes, NO, UNK

Calendar : Year,Qtr,Month


Fact for the year 2005,Q3,09

Chargable Account : All


Mile V AMT, D Amt,........

10 123.22 234.46
20 128.33 452.00
30 423.34 322.02
40 762.22 456.32



I want Mile same for whatever Chargable Account(All,Yes,No,UNK)

If user select either All,Yes,No,UNK Mile should be same, only if they
change Month mile can change for this dimension otherwise
if should display Month level value.

For above scenerio following MDX expression works fine,

IIF([Chargable Account].CurrentMember.Level.Name <> "(All)",
SUM([Chargable Account].[(All)].members,
[Measures].[SMiles],[Measures].[SMiles])


Now my requirment changed,

There is another measure

DOTCharge: (ALL,Yes, No, Unk)

IIF([Chargable Account].CurrentMember.Level.Name <> "(All)",
SUM([Chargable Account].[(All)].members, [Measures].[SMiles]),
IIF([DOTCharge].CurrentMember.Level.Name <> "(All)",
SUM([DOTCharge].[(All)].members, [Measures].[SMiles]),


Above statement fine, if either one (not both) of the dimension changes,

Now i want to total miles for that month,

If both DOTCharge,Chargable Account



For all other dimension mile can change accordingly

Can anyone help me


Thanks
Kalyan




Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Is this possible with dimension? - 03-15-2006 , 04:02 AM






You can simplify this whole calculation down to one statement that
returns the tuple constrained to the all member for both the Chargable
Account and DOTCharge dimensions.

eg.

([Chargable Account].[All Chargable Account],[DOTCharge].[All
DOTCharge], [Measures].[SMiles])

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1496A37D-0296-43F9-A22D-57B7E85E06F1 (AT) microsoft (DOT) com>,
Kalyan (AT) discussions (DOT) microsoft.com says...
Quote:
I am new to new to MDX queries,
Here is my situation, I am using AS2000

Dimension :

Charge,Calander,.......

Chargable Account: All,Yes, NO, UNK

Calendar : Year,Qtr,Month


Fact for the year 2005,Q3,09

Chargable Account : All


Mile V AMT, D Amt,........

10 123.22 234.46
20 128.33 452.00
30 423.34 322.02
40 762.22 456.32



I want Mile same for whatever Chargable Account(All,Yes,No,UNK)

If user select either All,Yes,No,UNK Mile should be same, only if they
change Month mile can change for this dimension otherwise
if should display Month level value.

For above scenerio following MDX expression works fine,

IIF([Chargable Account].CurrentMember.Level.Name <> "(All)",
SUM([Chargable Account].[(All)].members,
[Measures].[SMiles],[Measures].[SMiles])


Now my requirment changed,

There is another measure

DOTCharge: (ALL,Yes, No, Unk)

IIF([Chargable Account].CurrentMember.Level.Name <> "(All)",
SUM([Chargable Account].[(All)].members, [Measures].[SMiles]),
IIF([DOTCharge].CurrentMember.Level.Name <> "(All)",
SUM([DOTCharge].[(All)].members, [Measures].[SMiles]),



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.