Question

How can I get the aggregate information to appear in a matrix as in this example:

enter image description here

The query results are in a single row with columns representing each of the aggregate numbers.

Was it helpful?

Solution

Assuming your data is something like this:

enter image description here

You can set up a Matrix object to display something similar to your requirements:

enter image description here

Here I dragged City and Item into the Matrix row and column field respectively, then added another Row Group based on Category and a Column Group based on Date.

The end result is practically the same as your requirement:

enter image description here

The big caveat here is that SSRS 2005 offers very limited options for customising a Matrix, i.e. things like adding new columns, but you can see the example report is pretty close so this is worth considering.

OTHER TIPS

Report Design:

You can group by CITYID and instead of 1 detail line add 3 more detail and then put the corresponding field values.

With in the detail group right click the row and say add row within group and repeat it 3 times.

Database:

Other way is modify your dataset to break into four rows for each CITYID. Something Like

SELECT 'Delv' AS RowTag, Field1, Field2, Field3 FROM Table
UNION ALL
SELECT 'Sales' AS RowTag, Field4, Field5, Field6  FROM Table
UNION ALL
SELECT 'QOH' AS RowTag, Field7, Field8, Field9  FROM Table
UNION ALL
SELECT 'Diff' AS RowTag, Field10, Field11, Field12  FROM Table
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top