简体   繁体   中英

SSRS 2008 Matrix - How do I sort this simple dataset?

I have a dataset which has [Names] , [Level Achieved] , and [Month Achieved] .

I want the result to look like:

[Month Achieved] -> Displayed across the top in order from Jan - Dec
[Names] down the left side
[Level Achieved] under each month.

Using the wizard I choose a matrix, set the columns to [Month Achieved] , rows to [Name] and details to [Level Achieved]

Yet the months are being displayed unsorted. How do I sort the columns so they are in order?

After you complete the wizard, in the bottom of the Design view, you should see a pane for Column Groups. Right click on the month column group and select Group Properties.

In the resulting window you can select the Sorting section, where you can change or add the fields by which this group will be sorted. In your case, you might need to use a formula (the fx button) such as

 =SWITCH(Fields!Month_Achieved.Value = "January", 1,
         Fields!Month_Achieved.Value = "February", 2,
         Fields!Month_Achieved.Value = "March", 3,
 .
 .
 .
         Fields!Month_Achieved.Value = "December", 12)

This is if you are actually returning the Month names from your dataset and not a DateTime value for the month.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM