cancel
Showing results for 
Search instead for 
Did you mean: 

Reset manual running total on each group

Former Member
0 Kudos

Due to the fact that I can not sum a formula I am using a manual running total, I found in a previous post, and it works great to get the grand total. However, I need to somehow setup one that will reset at each new group so that I have a total on each group. Any ideas on how I could accomplish this? Does this make sense?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In order to have a running total that resets at each group AND a grand total at the bottom, you would need essentially 5 formula fields.

The first three are for the group totals:

1) the running total field that has


i :=i+{@total}

2) a reset formula in the group header with

i:=0

3) a display formula for i in the group footer.

Then another 2 formulas using a different variable

1) the running total field (placed in the same section as your other one) with

 WhilePrintingRecords;
Global NumberVar X;
X :=X+{@Total}

2) a display formula for X in the report footer.

Former Member
0 Kudos

That is perfect! I have been trying to figure this type of issue out for a long time now. I appreciate it very much.

Answers (1)

Answers (1)

Former Member
0 Kudos

Brent,

Place this formula in the group header:

WhilePrintingRecords;

Global NumberVar yourvariablename:=0;

Please note: you will need to create another variable if you want to keep your grand total.

I hope this helps;

Zack

Former Member
0 Kudos

Not sure I understand what to do. I am currently using the following:

Group Footer2

whileprintingrecords;

numbervar i;

i:=i+{@Total}

Report Footer

whileprintingrecords;

numbervar i;

Do I need to remove these?

former_member260594
Active Contributor
0 Kudos

You don't need to remove those. I am assuming that since the running total is evaluating in GF2 that you want a total for each instance of Group 1. In that case add a reset formula in Group Header 1,

whileprintingrecords;

numbervar i:=0;

Move your display formula, in the Report Footer, to Group Footer 1.

This will reset the running total variable to 0 for each instance of Group 1, evaluate each total in GF2, and display the total in GF1.

Former Member
0 Kudos

That worked on the group totals but now my grand total at the bottom does not work.

former_member260594
Active Contributor
0 Kudos

Right,

You will need to use 2 different variables, 1 for the group total and 1 for the grand total. You add another variable in the same formula currently in GF 2 and then create a new formula to display the result of that variable in the Report Footer.

Former Member
0 Kudos

How would that look? Do I create the same formula and just name it something different?