Search code examples
t-sqlreporting-servicesssrs-2012ssrs-tablix

SSRS Column Grouping Based on Row and Column


I've looked everywhere but found no luck and did some tinkering which didn't amount to much. I have a table that displays the following result set:

| Name | Value|
| Pat  | 1.6  |
| Pat  | 1.4  |

I have to group them in together by Row based on the first column (which is not a problem). Although I'm trying to make the report put the two numeric values in one cell in the Tablix.

This is what I need to do:

screenshot


And this is what I have achieved

achieved

I achieved the third one by grouping it by the first column of my result set as a Row group.

Any nudge to the right direction will be very much appreciated!


Solution

  • Add a new tablix and add Name field in the Row Groups Pane, then delete details group.

    enter image description here

    In the Value cell use the below expression:

    =join(LookupSet(
    Fields!Name.Value,
    Fields!Name.Value,
    Fields!Value.Value,
    "DataSetName"
    ),Environment.NewLine)
    

    Replace DataSetName by the actual name of yours. You will get:

    enter image description here

    UPDATE: Expression to surround the second value with parenthesis.

    =join(LookupSet(
    Fields!Name.Value,
    Fields!Name.Value,
    Fields!Value.Value,
    "DataSet4"
    ),Environment.NewLine & "(") & ")"
    

    Let me know if this helps.