Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Sorting members in a hierarchy

$
0
0

Hi,

I have a Dimension with 2 attributes that I want to order for a filter in a report. One of the attributes is [Client].[Client Group], and the other is [Client].[Client Code].

An example of the data:

  • (Client Group Level - ID="1", Display_Name="Client Group 1 ) - "Client Group 1"
  • _____(Client Code Level) - "1000"
  • _____(Client Code Level) - "2000"
  • _____(Client Code Level) - "3000"
  • (Client Group Level - ID="2", Display_Name="Client Group 1") - "Client Group 1"
  • _____(Client Code Level) - "1500"
  • _____(Client Code Level) - "3500"
  • _____(Client Code Level) - "5500"
  • (Client Group Level - ID="3", Display_Name="Client Group 2") - "Client Group 2"
  • _____(Client Code Level) - "1000"
  • _____(Client Code Level) - "2000"

I want the data in the filter to show as:

"Client Group 1 - 1000"

"Client Group 1 - 1500"

"Client Group 1 - 2000"

"Client Group 1 - 3000"

"Client Group 1 - 3500"

"Client Group 1 - 5500"

"Client Group 2 - 1000"

"Client Group 2 - 1000"

What I can't get to work properly is the ORDER() function in the MDX. I can get it to sort by the Client Group in ASC and the Client Code in BASC, but it sorts the Client Code in ASC within each Client Group (doesn't break the hierarchy). That code looks something like this:

ORDER([Client].[Client Group].[Client Group],[Client].[Client Group].MEMBER_NAME,ASC)
*ORDER([Client].[Client Code].[Client Code],[Client].[Client Code].MEMBER_NAME,BASC)

Any ideas on how I can change the MDX so that it sorts it properly?

Thanks in advance



Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>