Aug 23, 2003 #1 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?
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?
Aug 23, 2003 #2 lbass Technical User Feb 9, 2002 32,816 US 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 Upvote 0 Downvote
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