I am using a client tool that allows me to use MDX to specify the axis member of a chart. I need to show on the y axis the top 10 customers in sales order count over the last 12 full months. Because of the way the tool works, all of my logic must be in the axis expression. I cannot use a full MDX query (e.g. with a Where statement) to express this.
TopCount works perfectly if I limit the time period to a specific member, like, limited to orders for June of 2014:
TOPCOUNT([Customer].[Customer].children,10,([Measures].[order Count],[Date].[Month ID].[201406]))
A test query would look like this:
Select [Measures].[Order Count] on 0,
TOPCOUNT([Customer].[Customer].children,10,([Measures].[order Count],[Date].[Month ID].[201406])) on 1
from MyCube
But I need the date range considered in the count to be a specific range, like over the past 12 months, so I was hoping something like this would work:
TOPCOUNT([Customer].[Customer].children,10,([Measures].[order Count],{[Date].[Month ID].[201406]:[Date].[Month ID].[201506]}))
But when I do this I get the message:
The TOPCOUNT function expects a string or numeric expression for the 3 argument. A tuple set expression was used.
How can I do this? Actually, the date range I want to use is already defined in a named set. Ideally, the orders considered in the top 10 are only those orders in the named set, like:
TOPCOUNT([Customer].[Customer].children,10,([Measures].[order Count],[Specific Month Set]))
But when I try using only the named set I get:
The dimension '[Specific Month Set]' was not found in the cube when the string, [Specific Month Set], was parsed.
- Edited by GenoDave 7 hours 7 minutes ago