MDX - Sorting output by row header -
05-14-2004
, 01:00 PM
Given the following query:
Select Order({CrossJoin({[Customers].[Country].[USA]}, {[Education
Level].[Education Level].Members})}, [Unit Sales], ASC) On Rows,
{[Measures].[MeasuresLevel].[Unit Sales], [Measures].[MeasuresLevel].[Store
Cost], [Measures].[MeasuresLevel].[Store Sales]} On Columns
From [sales]
I would like to order the results in alphabetical order by the row headers.
In other words, I would like to sort first by Country and then by Education
Level. Is this even possible? If I think of the straight SQL equivalent,
you can't order the columns. They just appear in the order you list them in
the SELECT clause. I assume MDX row headers are the same way but I'm hoping
maybe not.
A follow up question is: How do I order a simple set of strings? If I have
4 groups of cities say, I can do the following to get a set of all cities:
{[CityGroup1], [CityGroup2], [CityGroup3], [CityGroup4]}. But how would I
sort the resulting set alphabetically by city name?
Thanks,
Russ |