Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total of a formula

Status
Not open for further replies.

ssudha

Technical User
Oct 14, 2002
62
IN
Hi All,

How can we create a running total from a formula?
For eg: I have a formula say 'aSum' as Sum(field, cond).
Can we create a running total of aSum?

Any ideas?
 
You would have to use a variable to do this. If you only have one group, you would create two formulas:

{@grptot} to be placed in the group footer:
whileprintingrecords;
numbervar grptot := grptot + sum(field, cond);

{@grptotdisplay} to be placed in the report footer:
whileprintingrecords;
numbervar grptot;

If you are accumulating at a higher group level instead of at the report level, then you would also need a reset formula:

{@resetgrptot} to be placed in group (higher level) header:
whileprintingrecords;
numbervar grptot := 0;

And then you would place {@grptotdisplay} in the group (higher level) footer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top