Summarise Report Data on Same Report?

  • I'm not sure if this is possible, it would seem like it should be! - Basically I have a report which lists a load of customers and the products attached to them on a row by row basis, so 2 products 2 rows etc.

    The report is generated by running a stored procedure.

    Before this was a report I could simply produce a summary like this:

    SELECT

    COUNT(distinct contact_id) as [No. Customers],

    Product_Description

    FROM V_Customers

    GROUP BY Product_Description

    Now, the view in the above isn't going to exist for much longer because an SP takes care of the data I need in SSRS, right now I'm thinking I need to create another SP and perform the summary by copy/pasting the code from the main SP, however, this seems like a poor idea - it's creating another object, the two aren't linked, it just seems wrong.

    I think there must be a way to do this in SSRS but I'm not even sure where to start - doing a sum on a column for example isn't going to do it...

    Any input appreciated. Thanks!

  • You should be able to use the same dataset and just add another table that is grouped at the level you want summarized.

    One other thing I have done is build the main report as a detail report that is fully collapsed so that when you initially open it you see the summary then you can drill down as you desire.

  • I'd never thought of that Daniel, that seems to do the trick perfectly, combined with a CountDistinct and I'm sorted!

    Thanks!

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

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