Sort all but one

  • Hello,
    I need to sort one of the groups in tablix using aggregate sum function. Sorting need to be applied to all rows but one, called "all other", should be always at the bottom (last). So i have the following expression:

  • IIF(Filelds!FieldName.Value="all other",-99999999999,Sum(Fields!Field2Name.Value))

  • But i'm not sure that that's the best solution. I wonder if next expression would be better fit to handle this problem.

  • IIF(Filelds!FieldName.Value="all other",Sum(Fields!Field2Name.Value) - 1,Sum(Fields!Field2Name.Value))
  • .

    Do you have any other, better ideas to solve this issue?
    Best regards,
    Lukas

  • I tend to solve these problems in my dataset by letting the query or stored procedure provide a sort value as a column in the dataset.  If you can post the query, we can probably help you get the data sorted.   I also don't let SSRS do aggregates for the simple reason that it seriously slows down the rendering of the report.   Let your stored procedure or query do the heavy lifting.

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • Thank you for a great answer. I'll use your advise and do sorting in dataset. I should make it on my own so i won't be bothering you with a query.

  • lukaszpiech - Saturday, June 16, 2018 12:07 PM

    Thank you for a great answer. I'll use your advise and do sorting in dataset. I should make it on my own so i won't be bothering you with a query.

    While it's always great to be able to do things on your own, never be afraid to ask for help.   It's not a sign of weakness, but a sign of strength.  Unfortunately, too many people don't ask for help when they should, and almost always because they mistakenly believe it to be a sign of weakness.   It takes strength to be able to open oneself up to the potential for criticism....

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

  • Viewing 4 posts - 1 through 3 (of 3 total)

    You must be logged in to reply to this topic. Login to reply