dbTalk Databases Forums  

Urgent help me, regarding MDX expression

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


Discuss Urgent help me, regarding MDX expression in the microsoft.public.sqlserver.olap forum.



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

Default Urgent help me, regarding MDX expression - 03-14-2006 , 08:28 AM






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   
Deepak Puri
 
Posts: n/a

Default Re: Urgent help me, regarding MDX expression - 03-14-2006 , 05:30 PM






Hi Kalyan,

If you're saying that the value should stay the same, regardless of both
DOTCharge and Chargable Account selections, maybe this will work:

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

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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.