Reputation: 1228
I have 4 groups and I only wanted to have running totals for 2 of them and show the total after the second group. Is there a way to do this?
Group1
DetailsA
records...
Group2
DetailsA
records...
TOTAL - SUM(records)
Group3
DetailsA
records...
Group4
DetailsA
records....
Upvotes: 1
Views: 12469
Reputation:
There are a couple of ways of doing this:
(1) Set up a running total to sum the appropriate field - add it to a group footing section which is suppressed where the group is not group2.
or
(2) Add a higher level of grouping on a formula set to 1 for the existing groups 1 and 2, and as 2 for groups 3 and 4, then add a sum of the appropriate field to the group footing section for the formula group (which should be suppressed where the formula is not 1). To do so:
give it a formula like:
if {TableName.GroupField} =
Group1 or {TableName.GroupField} =
Group2 then 1 else 2
(substituting actual Group1 and Group2 values as appropriate).
Insert a new group on TopGroup. You will probably find that this is now the lowest level of grouping - open the Group Expert to make it the top level of grouping.
{@TopGroup} <> 1
. If you now preview your report, you should see the desired total between the end of Group2 and the start of Group3.If it turns out you are likely to need to display the running total elsewhere in the report then I would suggest the first method, otherwise I personally would prefer the second.
Upvotes: 3