Get "Top 10 Selling Products Last Month" -
06-18-2005
, 10:27 PM
Hi,
I can't for the life of me see what is wrong with this statement (in a
named set definition).
head(order([Product by Group].[Product].members,([Measures].[Sale
value], tail(filter([Sales Period].[Month].members, [Measures].[Sale
Value] > 0),2).item(0))
, BDESC),10)
I am trying to show the top 10 selling products last month.
I have used a filter to get only months where sales have occurred, then
the tail function to get the last 2 ie. the current month and the
previous, then the .Item(0) to get the previous month.
Unfortunately, the results aren't right, in fact I can't even see where
it gets the figures from. If I hard code the appropropriate sales
period into the MDX then it works. Also, if I use the filter directly
to retrieve the last month (on a different axis) it seems to work.
What is going on?????
Peter. |