SSRS : Max of Given Values ? :)

  • Now this one sounds so simple but I am just not able to get there....If anyone can help it would be great.

    I have a tablix with several columns. I am using separate measures as values for this columns.

    Say, Column 1 (C1) has Measure (M1), similaryly C2 has M2, C3, M3 so on....There is a row grouping also...Say Month.

    Now I need to find the maximum of these values in fourth column, C4. Can we do that. This is probably too basic but something I am seriously missing.

    What I need is something like....

    Max

    (

    ReportItems!txt1.value,

    ReportItems!txt2.value,

    ReportItems!txt3.value

    )

    as a Value for 4th column.

    But we can't use MAX function like that....

    Any quick help ???

  • The reason I intend to use ReportItems is - There is no column grouping in my Tablix and the structure of Tablix is fixed.

    If it helps....

  • Add a Function to call in Reprot code

  • You could add a second dataset that does the max function in SQL. Assume that your first query accesses a table called MyData. Assume that your first query looks like:

    select field1, field2, field3 from MyData

    Now, add a new dataset to the report called MaxOfThree. Set up a query like this:

    select (select max(fieldvalue)

    from (select field1 fieldvalue union select field2 union select field3) as fields)

    as maxfieldvalue

    from MyData

    This will return the max of the three fields

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

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