![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Difficult MDX-Statement I have a cube with a dimension DATE (Year, Quarter, Month) and a measure "turnover". I need data to create a chart of the course of the turnover for each month of the last 3 years. My result table should look like this. Jan Feb Mar ... 2003 2004 2005 Is this possible ? Thanks for your help aaapaul |
#3
| |||
| |||
|
|
Paul - Unfortunately you can't do it with a single dimension. There's no MDX you can write to do what you want. You'll either have to create a new physical time dimension with just year, a year hierarchy off of the existing time dimension (which for all intents and purposes creates the same storage as a seperate physical dimension), or a virtual dimension off of a member property for year. (Depending on your front end, you may not be able to put different hierarchies of the same dimension on different axes. If that's the case, you can't use the extra hierarchy off of an existing dimension option.) If you don't have a huge cube, I'd recommend using a virtual dimension. However, with a really large cube, the lack of aggregations from a virtual will make queries using the virtual dim very slow. Good luck. - Phil "lvpaul (AT) gmx (DOT) net" wrote: Difficult MDX-Statement I have a cube with a dimension DATE (Year, Quarter, Month) and a measure "turnover". I need data to create a chart of the course of the turnover for each month of the last 3 years. My result table should look like this. Jan Feb Mar ... 2003 2004 2005 Is this possible ? Thanks for your help aaapaul |
#4
| |||
| |||
|
|
Unfortunately you can't do it with a single dimension. There's no MDX you can write to do what you want. |

#5
| |||
| |||
|
#6
| |||
| |||
|
|
I only want the TOP 20 of [PCENTER].[KT] not of all customers. How can I integrate this condition in the TOP-20 Selection ? |
#7
| |||
| |||
|
|
Unfortunately you can't do it with a single dimension. There's no MDX you can write to do what you want. Not quite right, I have some that can do it ![]() While you cannot have the same dimension on both axis at the same time you can create calculated measure that return only the value for a given month. This approach is kind of like what you have to do in SQL to pivot data. I have provided an example that works in Foodmart below. (I have only done the first 6 months as it involves a lot of repetitive typing) =========================== WITH MEMBER Measures.[Jan] as 'sum(filter(descendants(time.currentmember, [time].[month]),Time.currentMember.name ="1"),Measures.[Unit Sales])' MEMBER Measures.[Feb] as 'sum(filter(descendants(time.currentmember, [time].[month]),Time.currentMember.name ="2"),Measures.[Unit Sales])' MEMBER Measures.[Mar] as 'sum(filter(descendants(time.currentmember, [time].[month]),Time.currentMember.name ="3"),Measures.[Unit Sales])' MEMBER Measures.[Apr] as 'sum(filter(descendants(time.currentmember, [time].[month]),Time.currentMember.name ="4"),Measures.[Unit Sales])' MEMBER Measures.[May] as 'sum(filter(descendants(time.currentmember, [time].[month]),Time.currentMember.name ="5"),Measures.[Unit Sales])' MEMBER Measures.[Jun] as 'sum(filter(descendants(time.currentmember, [time].[month]),Time.currentMember.name ="6"),Measures.[Unit Sales])' SELECT {Measures.[Jan] ,Measures.[Feb] ,Measures.[Mar] ,Measures.[Apr] ,Measures.[May] ,Measures.[Jun] } ON COLUMNS, time.year.members ON ROWS FROM [Sales] ============================== -- Regards Darren Gosbell [MCSD] dgosbell_at_yahoo_dot_com Blog: http://www.geekswithblogs.net/darrengosbell |
#8
| |||
| |||
|
|
Paul and Darren - Forgive my misinformation. Darren's code, although having to be hardcoded for each existing member, does indeed work. A virtual dim will still be more dynamic and require no coding, but I'm still impressed with the >> solution. My apologies. - Phil |
![]() |
| Thread Tools | |
| Display Modes | |
| |