I've searched and experimented with this but still cannot get what I need.
This was dirt simple in Crystal, which I'm now porting to SSRS.
Here's an example data set:
Client | DeliveryId |DeliveryDate | DeliveryTotal | Item Bob | 1000 | Jan 01 | 50.00 | Socks Bob | 1000 | Jan 01 | 50.00 | Ties Bob | 2003 | Jan 03 | 14.00 | Socks Tim | 4500 | Jan 05 | 76.00 | Cufflinks
Here's the grouping structure:
Client DeliveryId (shows DeliveryTotal, DeliveryDate in group header) DeliveryDetail (shows Item, not DeliveryTotal since it is repeated in each record)
I need to show a client subtotal which sums all of the distinct DeliveryTotals for that client.
Here's an example showing the grouping and data:
Bob DeliveryID: 1000 DeliveryTotal: $50.00 DeliveryDate: Jan 01 Socks Ties DeliveryId: 2003 DeliveryTotal: $14.00 Socks Client Total: $64.00 (sum of the 2 DeliveryTotals, not the DeliveryTotal in each record since it is duplicated)
I've tried variations on Sum, Inscope, grouping contexts etc but no luck. Using any form of Sum multiplies the total by the number of records which is incorrect. If I could nest aggregates I'd be fine. If I could sum on ReportItems I'd be fine (I think). But it doesn't matter since SSRS doesn't allow either.
I've put some thought into using custom code, but then I'd be having to manually code grouping, sums, totals and resets on group change. That sounds ridiculous to me.
Can I somehow sum by group name, and DeliveryId? That would effectively create a sum at the right scoping level, and be a distinct sum for the entire Delivery record, not each detail row.
Again this was dirt simple in Crystal version 7... over 10 years ago.
Any suggestions?