Including a value once in a summed SSRS group

前端 未结 1 1415
灰色年华
灰色年华 2021-01-22 18:53

I have a data source which is pulling in event attendance information which looks like the following table.

Note that one booking can contain multiple attendees, causing

相关标签:
1条回答
  • 2021-01-22 19:33

    The version of SSRS is key here. In SSRS 2008R2, you can now nest aggregate functions:

    So this would now be a valid expression:

    =SUM(FIRST(Fields!BookingPrice.Value , "BookingGroupName") , "DateGroupName")
    

    If you aren't yet on 2008R2 then you can do some tricks with embedded code to keep a running total: http://beyondrelational.com/blogs/jason/archive/2010/07/03/aggregate-of-an-aggregate-function-in-ssrs.aspx

    The key here is that you add to the total in the embedded code once per group. Then retrieve the total and clear it out at the end of the group.

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