×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Summing conditionally calculated fields

Summing conditionally calculated fields

Summing conditionally calculated fields

(OP)
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?

RE: Summing conditionally calculated fields

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
http://www.kenhamady.com/
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)

RE: Summing conditionally calculated fields

(OP)
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.

RE: Summing conditionally calculated fields

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)..

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close