Former Member

# help needed again on Sub Total Report

Dear all, I have created sub total in my report by introducing group headers (Grouped by Reason Code).

Everything is fine however, the places where I have used formulas to calculate averages, the sub totals are getting cumulative.

For example

```Reason Code - Description - Jobs - Lenses - Averages
01
02
03
45
50
60
89
99

Sub Total ---                  12        xx       xx          8

100
123
134
159
187
199
Sub total          xxxxx    30        xx                    85

```

In the above example the range 100 - 199 has total of 77 not 85. The formula I am using calculates the average sub totals in cumulative manner.

Formula I am using to calculate the sub total for averages is

```whileprintingrecords;
Numbervar FAvg;
```

Please note: FAvg is declared in my formula to calculate the averages and to get total sum I used the above formula under Group footer.

How can I re-use this formula so that it only counts the total averages from within that group order specified?

Many thanks

Regards

Jehanzeb

10|10000 characters needed characters exceeded

Former Member
Sep 02, 2008 at 03:38 PM

Hi Jehanzeb Navid,

In order to get rid of cummulative sum you need to reset the value in each group header like

```whileprintingrecords;
Numbervar FAvg:=0;```

Regards,

Raghavendra

10|10000 characters needed characters exceeded
• Former Member

Yes! Yes! and then suppress them so that it doesn't show 0.00 on the group header.

Why didn't I think of that!!!!

You are the man! - 10 Stars!!

Regards

Jehanzeb

• Former Member
Sep 02, 2008 at 04:02 PM

Its not working. It resets the counter however it does not reset it on each group.

For example first set of group = 53=8, it shows 8 however in the next set it shows 2 whereas it should be 134+3..=79.