Reputation: 831
I am a total beginner with analysis services / performance point and I need some help to create a diagram.
I am using the Contoso sample database.
I found a tutorial which helped me to create the following diagram:
Months on X axis, Sales amount on Y axis and I displayed the data for the years 2008 and 2009
So with this diagram I get on X axis the months from January 2008 to December 2009. (I use data from [Date].[Calendar Month]) The problem is that I need to compare data of different years month by month. So on the X axis I need to display the month from january to december regardless of year information.
I tried to use MDX query and the parrallelperiod function but I could not display what I need. I thought I need to group the data by the name of the month so I tried unsuccessfully to use 'group by' like in sql. Maybe I need more data in the cube ? like the list of the months (without the year relation)
I'm not sure about the direction to take, any help would be greatly appreciated. I can provide more details if you need.
(It seems that adventurework has pretty similar dimensions so if someone did the same thing with this cube it would be great too.)
[EDIT]
Here is the query automatically generated:
SELECT
HIERARCHIZE( { [Date].[Calendar Month].&[200901], [Date].[Calendar Month].&[200902], [Date].[Calendar Month].&[200903], [Date].[Calendar Month].&[200904], [Date].[Calendar Month].&[200905], [Date].[Calendar Month].&[200906], [Date].[Calendar Month].&[200907], [Date].[Calendar Month].&[200908], [Date].[Calendar Month].&[200909], [Date].[Calendar Month].&[200910], [Date].[Calendar Month].&[200911], [Date].[Calendar Month].&[200912], [Date].[Calendar Month].&[200812], [Date].[Calendar Month].&[200811], [Date].[Calendar Month].&[200810], [Date].[Calendar Month].&[200809], [Date].[Calendar Month].&[200808], [Date].[Calendar Month].&[200807], [Date].[Calendar Month].&[200806], [Date].[Calendar Month].&[200805], [Date].[Calendar Month].&[200804], [Date].[Calendar Month].&[200803], [Date].[Calendar Month].&[200802], [Date].[Calendar Month].&[200801] } )
ON COLUMNS,
HIERARCHIZE( { [Date].[Calendar Year].&[2008], [Date].[Calendar Year].&[2009] } )
ON ROWS
FROM [Sales]
WHERE ( [Measures].[Sales Amount] )
CELL PROPERTIES VALUE, FORMATTED_VALUE, CELL_ORDINAL, FONT_FLAGS, FORE_COLOR, BACK_COLOR
[/EDIT]
Thank you.
Upvotes: 0
Views: 1188
Reputation: 1993
If you do not want to change the relationship between the time dimension attributes you can like this one:
WITH SET [months_2008_2009] AS { [Date].[Calendar Year].&[2008].Children, [Date].[Calendar Year].&[2009].Children }
MEMBER [Date].[Calendar Month].[January] AS Aggregate(Filter([months_2008_2009] , [Date].CurrenMember.MemberValue = 'the member value for January'))
MEMBER [Date].[Calendar Month].[February] AS Aggregate(Filter([months_2008_2009] , [Date].CurrenMember.MemberValue = 'the member value for February'))
SELECT {[Date].[Calendar Month].[January], [Date].[Calendar Month].[February]} ON COLUMNS
FROM [Sales]
WHERE ( [Measures].[Sales Amount] )
In [months_2008_2009]
there should be all the months in 2008 and 2009.
[Date].[Calendar Month].[January]
is a calculated member that will be the aggrgation of [Date].[Calendar Month].&[200801]
and [Date].[Calendar Month].&[200901]
. You have to add other members for the other months.
I assumed than [Calendar Year]
and [Calendar Month]
are two levels that belong to the same hierarchy.
Upvotes: 1
Reputation: 11
Change attribite relationships between Time dimensions attributes as following: Date->Month->Year and then you can chose whatever Year in the filter, the month in the X axis will be for a corosponding Year. If you have May in X Axis and not choosen any year (by default is All member) then you will have accumulated all May's, but if you choose Year 2010, down you will have May 2010 and if you choose in teh filter Year 2011 in X axis you will May 2011.
Upvotes: 1