Hi I am want to create a pie chart in a reporting services report, but am unsure how to best write the MDX to get the results I need. Say I have some MDX like this: Select [Measures].[Dollars] on columns, [Organisation].[Organisation].Members on rows from [Sales] This would return the Sales for each organisation, which is ok, but now I need to make a pie chart which shows segments for the sales for the top 5 organisations, and all of the rest of the organisations are lumped into a segment called Other (so the pie chart will have 6 segments). I can easily use topcount to modify the above query to get only the top 5 organisations, but I am unsure how to get the top 5 and lump all of the rest of the organisations into another seperate row. Can anyone tell me how to write the MDX that I require ? or is there a way to configure the pie chart in reporting services to do what I want? thanks Stuart
I have worked out a solution for this if anyone is interested. I have created a calculated member which displays the organisation name if it is in the top 5, or shows the string "Other" if it is not. Now just do the chart using the calculated member as the group. with member [Measures].[GroupName] as 'iif([Measures].[Dollars],iif(CROSSJOIN(topcount([Organisation].[Organisation Name].[Organisation Name].Members,5,[Measures].[Dollars]),[Organisation].[Organisation Hierarchy].currentmember).Item(0).Item(0).Name = NULL,[Organisation].[Organisation Hierarchy].currentmember.Name,"Other"),NULL)'
Don't see what you're looking for? Try a search.
|