SSRS - Sort tablix based on result of Lookup

Viewed 45

Is it possible to sort a tablix in SSRS based on the result of a Lookup?

This is my lookup:

=Lookup(Fields!AcctNumber.Value, Fields!AccountNumber.Value, "FOUND", "DetailsDataset")

Which populates a column with "FOUND" if the account number is found in the "DetailsDataset" and with nothing if it is not. Is it possible to get all of the "FOUND" entries to go to the bottom so only the ones not found are at the top?

I have tried putting my expression in the Sorting of both the Tablix Properties and the Group Properties but neither work. No other sorting is being done on either one.

Thank you for any help!

1 Answers

It should work on the row group sorting. I tired this myself and it worked as expected....

He's a quick GIF to demo my test. The first run is with no sorting (although I started recording late so it's only visible for half a second...) so you can see the raw data, then I apply the sort expression and test again, and finally reverse the sort.

enter image description here

Related