how to sort Rows on a specific Column Data value
Hi, I'v searched without success, so this is my question: I have a report in SSRS designer 2008 like this: Year2010 Year2011 Row1 22 55 Row2 33 44 When I go to the Row Group Properties and set Sorting on details values, the report sorts on the Values on Year2010 (on the first column), but I want to sort on Year2011. How can I do this please? (I do not want to use interacitve sort) Thanks!
December 5th, 2011 6:06pm

Try to use this in the sorting properties of the Row Group =Sum(iif(Fields!Year.Value="Year2011",Fields!Sales.Value,0)) I am assuming that you have a filed called Year and Year2010 and Year2011 are values of that field. Similarly, I am assuming that the measure name is Sales.Cheers, Jason P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :) Follow @de_unparagoned
Free Windows Admin Tool Kit Click here and download it now
December 5th, 2011 6:18pm

How about setting the Tablix sort properties to year, desc. Click on the tablix and when the table appears right click on the Grey box where the row meets the column. Select Tablix Properties then sorting. Thanks, TrishTrish Leppa
December 6th, 2011 2:01am

Jason, =Sum(iif(Fields!Year.Value="Year2011",Fields!Sales.Value,0)) is not working, gives error: "The Sort expression for the group X uses an aggreagate function on data of varying data types..." I've tryed this: =iif( Fields!Calendar_Year.Value="Y2011", Fields!TO_SYS.Value, nothing) This is also not working, seems random sort. (my fields used) What I'm doing now (till better solution) is sorting on the "Row Groups" Sorting as: =Sum(Fields!TO_SYS.Value) This sorts Rows accroding to the sum of all Years, BUT I want the last year in Column which is Y2011. Trish, if I'm getting you right, the sort is done auto on first column, so the first year in the "Column Groups" (in this case Y2005)= NOK Any other help is very welcom please.
Free Windows Admin Tool Kit Click here and download it now
December 6th, 2011 10:13am

Are you getting data from cube or dataset? From the error, seems that there are different datatypes involved. You can convert all the values to same datatype and then sort. Adding the convert function to what Jason has suggested will give the solution. =Sum(iif(Fields!Year.Value="Year2011",CINT(Fields!Sales.Value),0)) If you are getting from dataset, convert the values to integer in the select statement.
December 6th, 2011 11:03am

The technique I said would work as I have tested in my system. The only reason for it to not work is because the Sales field returned by your query would not be numeric, so adding a cint function as Kiranmayee said should work. Cheers, Jason P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :) Follow @de_unparagoned
Free Windows Admin Tool Kit Click here and download it now
December 6th, 2011 11:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics