1
votes

I have an MDX query where I am returning a list of products and the total sales value for that item from my SSAS cube, like so:

 SELECT  
 NON EMPTY   
 { [Item].Children } ON COLUMNS,
 { [Total Line Value] } ON ROWS
 FROM        [Sales Analysis]

What I would like to do is sort the results in a descending fashion (ie the part that has sold the most will be at the top, and so forth). Is this possible? Any help would be appreciated, thanks.

1

1 Answers

2
votes

Try this

SELECT  
 NON EMPTY   
 Order([Item].Children, Measures.[Total Line Value], DESC) ON COLUMNS,
 { [Total Line Value] } ON ROWS
 FROM        [Sales Analysis]