beautypg.com

HP Intelligent Management Center Standard Software Platform User Manual

Page 267

background image

15.

Now create the "CanadaTotal" running total field using the process outlined
in steps 5-13. The only difference is that this time you will set the
evaluation formula to:

{Customer.Country} = "Canada"

16.

When you are finished, place the #CanadaTotal field in the Details section
of your report

Note:

If you only want to see a grand total of the Canadian and American sales,
place the two running total fields you created in the Report Footer section
of your report.

Creating running totals in a one-to-many linking
relationship

A one-to-many linking relationship occurs in linked tables when a single
record in one table can be matched with many records in another table. For
example, a one-to-many link might occur when you link a customer table to
an orders table. It wouldn't be unusual in such a case for each customer in
the primary table to have many orders in the second (lookup) table. In your
report, the field values from the primary table are repeated for each new field
value in the lookup table.

Creating a subtotal on a field from the primary table provides an incorrect
result because the repeated values are included in the calculation. You can
avoid this problem by creating a running total.

This concept can be demonstrated with the sample Xtreme database by
using the Customer and Orders tables.

To create a running total in a one-to-many linking relationship

1.

From the Field Explorer dialog box, place the following fields from left to
right in the Details section of your report:

{customer.CUSTOMER NAME}
{customer.LAST YEAR'S SALES}
{orders.ORDER ID}
{orders.ORDER AMOUNT}

Crystal Reports 2008 SP3 User's Guide

267

11

Running Totals

Creating running totals