2

I have a table in SSRS with a column which uses the expression

(Reportitems!Textbox71.Value / Reportitems!morCodeTextbox.Value) 

This obviously divides one table filed by another and displays a percentage for each line.

I'm struggling to see how I can then order this percentage column to show the highest percentage in first row and then descending results. When I try and sort the table by going to table properties the available fields only include those from SQL query. Am getting errors when trying to use an expression to sort. Tells me that I can't use report items in sort expressions.

Does anybody know how I can achieve this?

user1022772
  • 651
  • 3
  • 14
  • 29
  • The first thing that came to mind was just using the content of those ReportItems directly in the sorting expression, but as you noted in a comment to my (now deleted) answer: this won't work if there's aggregates involved. [This related question](http://stackoverflow.com/q/6385176/419956) may then hold your (not very satisfying, imo) answer. – Jeroen Jul 09 '13 at 12:58
  • Thank you. That solved the problem. It was your answer detailing the expressions to use (not just the report items) but just on the row group properties instead of tablix properties. Really appreciate you spending the time to come back to me. – user1022772 Jul 09 '13 at 13:22
  • Sure thing, glad to hear you solved it. Could be useful to post your final solution in an answer and accept that, makes it easier for others with the same problem to spot the solution. – Jeroen Jul 09 '13 at 13:56

1 Answers1

0

you need to add a Sorting to table by expression: "(Reportitems!Textbox71.Value / Reportitems!morCodeTextbox.Value)"

NinoEmma
  • 127
  • 2
  • 12