×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

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

# Help: Summing a group field

## Help: Summing a group field

(OP)
Hi. I've been banging my head on the wall for a while on a report and I could use some suggestions. I'm working on a report where I really need to get a summary of a group field, which Crystal won't let you do. Is there any kind of work around for this? Here's some details:

I'm pulling a sub-total of two fields in my details into my group section. I then have a formula field that calculates a value off of those sub-totals. I need to add up the formula values for each occurrence of the group in the report. Is there a way to do this? For a little more detail, I'm grouping by customer, and calculating commissions based on the sub-total sales vs cost for each customer. So if my sales guy gets $500 for one customer, and$250 for another, and $250 for a third, I want to be able to print "Total Commission=$1000" at the end of the report.

Any help would be appreciated.

### RE: Help: Summing a group field

I would hold the values of the formula in a variable until the report footer.

So, next to the formula subtotal, have another suppressed formula which says

whileprintingrecords;
numbervar total := total + {@YourTotalField};

in the report footer;

whileprintingrecords;
numbervar total;

Naith

### RE: Help: Summing a group field

(OP)
God Bless you Sir. Works like a champ. Never played with the WhilePrintingrecords function, and I was curious if that was where I needed to go. You just made my day go from horrible to great (I've been playing with the report for 2 weeks due to numerous changes from management)! Thanks!

Landon

### RE: Help: Summing a group field

If you have any problems with this in the future, for heaven's sake man; don't wait 2 weeks! ;)

Naith

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

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:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!