Summing Group Items in SSRS 2008 R2

后端 未结 1 1702
旧时难觅i
旧时难觅i 2021-01-18 00:48

I have what I think is a fairly simple problem, but can\'t for the life of me figure out how to do it (SSRS 2008 R2). I\'m using a tablix, as I need to display detail data (

1条回答
  •  不知归路
    2021-01-18 01:40

    Often this question is asked for older versions of SSRS, so it's nice to answer for a recent version that supports the feature you need. SSRS 2008R2 introduced support for aggregates of aggregates.

    In your total box for the report set the expression to be:

    =SUM( MAX(Fields!ShipTotal.Value, "TrackNo"), "DataSetName")
    

    As you mentioned, the Scope is a key part of this. The expression above indicates that SSRS should take the First ShipTotal for each "TrackNo" group, and add those up for every TrackNo group in the dataset. (Substitute your data set name in there, of course.)

    Two other two methods to get this result will also work in earlier versions of SSRS as well:

    • Use Embedded code to keep track of the aggregate.
    • Perform the math in your query, return the result with a different dataset, or as a new field with each row.

    0 讨论(0)
提交回复
热议问题