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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum by group not working 1

Status
Not open for further replies.

Oona8

Technical User
Apr 3, 2002
25
FR
Hi
I'm using CR 8.5
I'm trying to do a sum of a field (sum by contract), but as the field is repeated several times in my report my sum is wrong as it counts all the times the field is displayed

example

Contract ID Field1 Field2
1 250 5
1 250 8
Sum 500 (but I want it to be 250 as I want a total per contract)

Hope that makes sense for someone and there's a solution!

Thanks in advance

Oona
 
hi
try max or min on your field
or distinct count
max(field_name) or min(field_name
distinct count(field_name)
hope this help

pg
 
You shouldn't need to sum BY contract if the 250 IS the amount of the contract. Just group by contract and put the amount on the GF (no sum needed).

If you need to grand total these contract amounts, then you need to use a running total set to EVALUATE on change of the contract group.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top