I’ve been asked to create a report grouped by values in multiple columns on a single row from a SQL database. For example
Employee Name | Type1Column1 | Type1Column2 | Type2Column1 | Type2Column2
John Doe | 0.00 | 10.00 | 20.00 | 20.00
Report Output
Name | Type | Total
John Doe | Type1 | 10.00
| Type2 | 40.00
I hope you get the idea and no i did’nt design the table and no i can’t change it but i might be able to tweak the stored procedure which produces the output…
I played around with a few ideas but I’m at a loss; I feel like need some sort of calculated something to group against but i’ve never come up against this before as i’ve always designed the datawarehouse and cube myself.
Does anyone have any idea how i could achieve this in SSRS 2008R2 ?
Thanks in advance.
Can you apply the UNPIVOT operator to the query returning that output?
Note that the derived table f is grabbing data from a table called storedprocdata. Also the case statement in the main select statement allows grouping the columns you have explicitly by the different types you want.
You can then do an aggregate sum on the Total column within your SSRS report.