简体   繁体   中英

SSRS (report builder) sorting a row

My requirement is I have to sort a row Month Wise, that is Jan, Feb, Mar etc right now it is not sorted.

I have tried writing query under query window order by case when...

I have tried writing query in expression of month field ie

   IIF(Fields!Month_Y.Value = "Feb-19", 2,
   IIF(Fields!Month_Y.Value = "Mar-19", 3,
   IIF(Fields!Month_Y.Value = "Apr-19", 4,
   IIF(Fields!Month_Y.Value = "May-19", 5,
   IIF(Fields!Month_Y.Value = "Jun-19", 6,
   IIF(Fields!Month_Y.Value = "Jul-19", 7,
   IIF(Fields!Month_Y.Value = "Aug-19", 8,
   IIF(Fields!Month_Y.Value = "Sep-19", 9,
   IIF(Fields!Month_Y.Value = "Oct-19", 10,
IIF(Fields!Month_Y.Value = "Nov-19", 11, 12)))))))))))

I have wrote same IIF condition query in Tablix - Sorting expression field too.

But still it is not sorting the report month wise. if anyone can have a look and give the solution please.

Thank you in advance.

I understand from your question that you tried to use "case" on the "data set"

I have tried writing query under query window order by case when...

So the next thing that you need to do is:

  1. Right-click on the column.
  2. Go to "Shorting".
  3. Press "Add".
  4. Choose your "number" column(that you mapped - "Feb-19" etc.).
  5. Choose your order method "ZA" or "AZ".

I simulated your case and it worked for me.


See the image below

在此处输入图像描述

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