nemesis1210
asked on
Crystal Reports Running Total in a Formula
Looking to find out how to write a formula that will calculate the running total of a field and reset on change of a group
ASKER
unfortunatly I need to get fancy, I need to be able to run a calculation on two existing running totals and am unable to do so, so I am hoping to be able to create formulas for these as opposed to running total fields so I can perform my calculation.
Thanks anyhow
Thanks anyhow
You can manually create runnign totals, or "fancy" formulas by adding formula fields to the sections you want..
you could put the reset field in the group header, the increment field in the detail, and the display in the footer.
using something like this in the code:
you could put the reset field in the group header, the increment field in the detail, and the display in the footer.
using something like this in the code:
//begin increase value;
WhilePrintingRecords;
numberVar SomeVal;
SomeVal := SomeVal + {tablName.FieldName}
//end
//begin reset value;
WhilePrintingRecords;
numberVar SomeVal;
SomeVal := 0;
//end
//begin display value;
numberVar SomeVal;
SomeVal
//end
missing semi-colon (;) on line 4
ASKER
almost there, values increase during the detail and reset at each group, however display is always zero in the footer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect thank you
ASKER
Worked like a champ
You welcome :)
You can use a RunningTotalField (should show up in your fields list, right click and hit new) .
The running total field allows you to change when you want to evaluate, and when you want to reset.