dbTalk Databases Forums  

MDX - Last Year's Last Month

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


Discuss MDX - Last Year's Last Month in the microsoft.public.sqlserver.olap forum.



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

Default MDX - Last Year's Last Month - 08-29-2003 , 07:03 AM






Hi,

I have time dimension which have levels year, half year, quarter and
month. Also I have measure whose name is cost.
I want to write a calculated member which shows last december's cost
value. For example if the currentmember of time is 2003 or Q1.2003 or
november 2003 or march 2003, calculated member must be december 2002
value.

Does anyone have any idea? Thanks....

Bahar



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

Reply With Quote
  #2  
Old   
asim73
 
Posts: n/a

Default Re: MDX - Last Year's Last Month - 08-29-2003 , 07:53 AM







(closingperiod(month,ANCESTOR([TIME].CURRENTMEMBER, year).prevmember) ,
measures.cost)



Try the above and please let me know if it worked or not in both

cases.





Thanks



Asim Naveed


--
Posted via http://dbforums.com

Reply With Quote
  #3  
Old   
Rob Anderson
 
Posts: n/a

Default Re: MDX - Last Year's Last Month - 08-29-2003 , 10:25 AM



Try looking at the ParallelPeriod Function to return the previous year and
the ClosingPeriod function to get the last month...
something like below from foodmart database

select
{[Measures].[Amount]} on columns,
{ClosingPeriod([month],(ParallelPeriod([Year], 1, [time].[year].[1998])))}
on rows
from budget



"bahar karaoglu" <bahar_karaoglu (AT) yahoo (DOT) com> wrote

Quote:
Hi,

I have time dimension which have levels year, half year, quarter and
month. Also I have measure whose name is cost.
I want to write a calculated member which shows last december's cost
value. For example if the currentmember of time is 2003 or Q1.2003 or
november 2003 or march 2003, calculated member must be december 2002
value.

Does anyone have any idea? Thanks....

Bahar



*** 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.