Print Page | Close Window

Running total - Resetting on change of field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3861
Printed Date: 02 May 2024 at 2:30am


Topic: Running total - Resetting on change of field
Posted By: awhawh
Subject: Running total - Resetting on change of field
Date Posted: 31 Jul 2008 at 12:30pm

I was wondering if someone could help me regarding an issue I have with running totals.

Currently, the running totals feature allows you to select the following:
  • [reset] on change of field
  • [reset] on change of group
  • use a formula

What I would like to do is use the first option and select more than one field. However, the option only allows you to select one field.

My question is, could I write a formula to mirror what the the 'change of field' is doing, but with more than one 'change of' field?
 
The example belows shows that on the change of 'Name' and 'Account', calculate the total money that has left the account.
 
Name                Acount                Money out (my running total)
 
P.Jones             Account XYZ        -12,000
A. Michaels        Account ABC       -23,000
A. Michaels        Account 123       -14,000
 
If I create a 'change of field' for just the 'name' I would get the following:
 
Name                Acount                Money out (my running total)
 
P.Jones             Account XYZ        -12,000
A. Michaels        Account ABC       -37,000
A. Michaels        Account 123       -37,000
 
Note: I have incorporated the running total within a cross-tab.
 
Thank you
 
Adam



Replies:
Posted By: BrianBischof
Date Posted: 31 Jul 2008 at 5:37pm
Yes, you'll have to use the third option that uses your own formula. For example,
{yourtable.Name} <> PreviousValue({yourtable.Name} AND
{yourtable.Account} <> PreviousValue({yourtable.Account}
I cover all the running total options as well as how to write custom functions in my Encyclopedia book. You can find out more about my books at http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Amazon.com or reading the http://members.crystalreportsbook.com - Crystal Reports eBooks online.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: awhawh
Date Posted: 01 Aug 2008 at 2:45am

I shall give this a go.

Thanks for your help




Print Page | Close Window