To create running totals using a formula – HP Intelligent Management Center Standard Software Platform User Manual

Page 269

Advertising
background image

When you create a running total manually, you need to create three formulas:

A summary formula.

A reset formula to set a variable to zero.

A display formula to display the variable.

In the following procedure, you will create a report that performs the following
functions:

Maintains a running total of customer orders.

Groups customer orders and resets the running total for each group.

Displays the subtotal for each order (the last running total for that order).

To create running totals using a formula

1.

Create a report using the sample data, Xtreme.mdb. Link the Customers
and Orders tables and place the following fields from left to right in the
Details section:

{customer.CUSTOMER NAME}
{orders.ORDER ID}
{orders.ORDER AMOUNT}

Note:

Xtreme.mdb is located on the Business Objects Technical Support web
site

http://support.businessobjects.com/samples/

.

2.

On the View menu, click Field Explorer.

3.

Select Formula Fields in the Field Explorer dialog box and click

New.

4.

Name the formula "RunningTotal" and click Use Editor.

The Formula Workshop appears with Formula Editor active.

5.

Enter the following into the Formula box:

WhilePrintingRecords;
CurrencyVar Amount;
Amount := Amount + {Orders.Order Amount};

6.

Click the Save and close button on the Formula Workshop.

Crystal Reports 2008 SP3 User's Guide

269

11

Running Totals

Creating running totals using a formula

Advertising