Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing conditionally calculated fields

Status
Not open for further replies.

tfish

Technical User
Apr 12, 2001
3
US
In my report, I have a calculated field that determines an account balance by two criteria (an account type and the sum of dr/cr's in the account). This is done with a series of IF, ElseIf statements. I want to sum the resulting column(s) independently but Crystal will not let me generate a grand total or running total on this field for the report footer. What am I doing wrong?
 
Post the formula.

It probably has a total in it somewhere, which means you have already used your first strike. We either have to re-write the formula without the total, or you will have to use a variable to create a running total. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks for the assist, Ken. I've gone back to the drawing board and I'm re-writing the running total formula manually. I think I'm on the right track; it's only a matter of time at this point.
 
I run into this problem all the time. First, create a KOUNTER variable with the formula:

whileprintingrecords ;
shared NumberVar KOUNTER := KOUNTER + {value to be added} ;

Now, create a variable called RESET with the formula:

whileprintingrecords ;
shared NumberVar RESET := 0 ;

Put the RESET variable in the group header, or wherever you want the accumulated total to reset to zero, and SUPPRESS it.

Put the KOUNTER variable in the DETAILS section, and when you run the report, KOUNTER will give you a running total and will start over whenever it encounters the RESET variable (i.e., whenever the HEADER changes)..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top