Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you help with MDX Expressions

Status
Not open for further replies.

TTSimon

Programmer
May 13, 2004
2
GB
We need to compare the current weeks Sales figures with the same week of the previous year. Simply enough, but as well as going back one year we also need to go back a previous season code....

C1 - Conitinuous ( never alters)
E3 - Spring 2003
E4 - Spring 2004

So when you compare Week 200420 with 200320 you also need to switch seasons... For example [Week:200420, Season:E4] compares with [Week:200320, Season:E3].
With C1 season, however this is not required. Only the week on week comparison is necessary.

I have a Time.CalendarWeeks Dimension, and a Seasons Dimension that go like....

C1 - Continuous
E2 - Spring 2002
E3 - Spring 2003
E4 - Spring 2004
H2 - Winter 2002
H3 - Winter 2003
H4 - Winter 2004


I wrote Calculated Expression which does the job nicely, but it falls over if more than one Season is selected in the Page filter in Excel.

My solution is...

iif( LEFT([Item Seasons].CurrentMember.Name,1) = "H" OR LEFT([Item Seasons].CurrentMember.Name,1) = "E" ,
([Measures].[Sales Total Qty],[Item Seasons].PrevMember,ParallelPeriod([Time].[CalendarWeek].[Year])),
([Measures].[Sales Total Qty],ParallelPeriod([Time].[CalendarWeek].[Year])))

How can I modify this to cope with multiple season selections, as it seems to take the first in the list as the 'CurrentMember' and ignores further selections.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top