dbTalk Databases Forums  

More MDX - Please help

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


Discuss More MDX - Please help in the microsoft.public.sqlserver.olap forum.



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

Default More MDX - Please help - 04-12-2004 , 03:22 PM






Hi all,

I am desperately to write this query...

Here's the algorithm:

If [Time Calendar].CurrentMember.Level is [Time Calendar].[Month] Then

LastPeriods(12, [Time Calendar].CurrentMember)

Else if [Time Calendar].[CurrentMember].Level is [Time Calendar Quarter]
Then

Sum(QTD([Time Fiscal].CurrentMember),[Time Series].[Value] )

In English, if a member in the time dimension is at the month level,
then we roll back by 12 months. If the member is at the Quarter level,
then I want the QTD of that quarter.

I hope this makes sense,

Audrey




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: More MDX - Please help - 04-12-2004 , 08:00 PM






It's not clear why you want QTD for a quarter, since that's the value
for that quarter. With that in mind:

Quote:
iif([Time Calendar].CurrentMember.Level
is [Time Calendar].[Month],
Sum(LastPeriods(12,[Time Calendar].CurrentMember),
Time Series].[Value]),
Time Series].[Value])
Quote:


- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.