Sort using expression

  • Hi all,

    Could you please help me to sort the data set by the expression?

    The expression is - Last(Fields!Volume.Value)-First(Fields!Volume.Value).

    As far as I read it impossible- to sort by expression

  • I'm not sure if it's me, but if you have the first and last values in a dataset, e.g.:

    1

    5

    16

    1

    you would be sorting by 1-1, i.e. 0 over the whole set, which doesn't make sense. Is  that what you really want? If not, could you provide more detail, and preferably sample code that can be run and tested

  • Hi,

    I have such data as on the picture.

    I have calculated value Difference and I need to order this calculated value..

    As far as I read that it impossible to sort the calculated values...

    Attachments:
    You must be logged in to view attached files.
  • You might want to look at Jeff Moden's  article on how to post code problems:  https://qa.sqlservercentral.com/articles/forum-etiquette-how-to-post-datacode-on-a-forum-to-get-the-best-help

    Having said that, it looks as if you are using SSRS to crosstab, and there can be any number of columns as (presumably) the column headings are a range of dates. In that case, you aren't looking for the first and last in a column, probably the minimum and maximum in a row; however, just showing a screenshot doesn't help us understand what you are trying to do

    If you were to create the data as an SSRS dataset then you would be able to sort on a "Difference" column, but without more information it's impossible to know. If you need more help you need to explain what you are trying to do and provide sample datacode in the form as described

    One other thought: there may be a simpler way of presenting the data than what you are trying to do. I try and follow a rule that says if something starts to get really complicated in the presentation layer it's probably not the best way of providing the data

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

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