If you are working with a version of crystal that is lower than 7, you do not have the option of using the running total expert, and will need to create a manual running total.
Try This:
Running Total Formulas with Groups:
The following formulas create a subtotal based on the change of a Group. This example assumes a sales database is grouped and sorted in order of country. The first formula declares the variable and resets the variable to zero when the country changes. The second formula calculates the subtotals and grand total for each record. The third formula displays the subtotal for each country. The fourth formula displays the grand total for all the records in the report.
Formula 1
This formula resets the variable to 0 each time the country changes. Place this formula in the Group Header section. This formula is crucial to the calculation but it does not need to be displayed and the formula field can be formatted to ‘Hide When Printing’.
@CountryReset (this is the formula name, it is not part of the formula)
WhilePrintingRecords;
CurrencyVar SubTotal := 0
Formula 2
This formula calculates the sub totals and grand total. Place this formula in the Details section of the report to make sure all records are evaluated to accumulate a total.
@DetailFormula (this is the formula name, it is not part of the formula)
WhilePrintingRecords;
CurrencyVar SubTotal;
CurrencyVar GrandTotal;
GrandTotal := GrandTotal + {company.LastYrSale};
SubTotal := SubTotal + {company.LastYrSale}
Formula 3
This formula displays the final value of the SubTotal variable for each country. Place this formula in the Group Footer section. When a group change occurs, SCR begins at the Group Header again and this executes the @CountryReset formula which resets the SubTotal variable to 0 for the next country.
@ShowSubTotal (this is the formula name, it is not part of the formula)
WhilePrintingRecords;
CurrencyVar SubTotal;
SubTotal
Formula 4
This formula displays the grand total of all the records in the report. Place this formula in the Report Footer section to print the accumulated final total. The GrandTotal variable does not reset with each group change as the value continually increments until the report ends.
@ShowGrandTotal (this is the formula name, it is not part of the formula)
WhilePrintingRecords;
CurrencyVar GrandTotal;
GrandTotal
Cheers,
-Bruce Seagate Certified RCAD Specialist.
-Bruce Thuel-Chassaigne
roadkill150@hotmail.com