Operation Manual
Running Totals
Understanding running totals
11
204 Crystal Reports User’s Guide
Understanding running totals
Running total fields are similar to summary fields but allow more control over
how the total is calculated and when it is reset. Running total fields are
specifically suited to perform the following totaling functions:
• Show values of a total accumulate as it is calculated record by record.
• Total a value independent of the report’s grouping.
• Total a value conditionally.
• Total a value after a group selection formula has been applied.
• Total a value from the driving table in a one-to-many linking relationship.
How running totals work
A running total field is created with the Running Total Expert. The Running
Total Expert creates a running total field by asking you to select a field to
summarize, the summary operation to use, a condition upon which to base
the evaluation, and a condition upon which to reset the evaluation.
Note: A running total field can be used on database fields and first-pass
formulas, but cannot be used on second-pass formulas or formulas that
reference other second-pass formulas. For more information see “Multi-pass
reporting flow chart” on page 530.
Placement of running total fields
The calculation of a Running Total field is determined by the settings selected in
the Running Total Expert. However, where you place the running total affects
the value that appears on the report. For example, if a Running Total field that
evaluates every record and never resets (a grand total) in the Report Header,
only the value of the first record will appear. Placing the same Running Total
field in the Report Footer returns the desired value. The Running Total field is
properly calculated in both cases, but it is displayed too soon in the first case.
The following list summarizes the records that are included in the calculation
when a running total is placed in various report sections. This list assumes
the running total is not reset.
Report Header The first record in the report
Page Header All records up to and including the first record on the current
page
Group Header All records up to and including the first record in the current
group