We can sort an axis based on the member on that axis, or on the measure.
Based on the member: Based on the measure:
To sort an axis based on the member, we can use the NAME property:
select non empty
order
( {[Customer].[City].[All].Children},
[Customer].[City].CurrentMember.Name, DESC
) on 1,
[Measures].[Internet Sales Amount] on 0
from [Adventure Works];
To sort an axis based on the measure, we use the measure name:
select non empty
order
( {[Customer].[City].[All].Children},
[Measures].[Internet Sales Amount], DESC
) on 1,
[Measures].[Internet Sales Amount] on 0
from [Adventure Works];
Here are this and some other articles on Sorting dimensional members:
http://ssas-wiki.com/w/Articles#Sorting_dimensional_members
Comment by Sam Kane — 16 March 2011 @ 8:13 pm |