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

Computing Averages

Status
Not open for further replies.

rlporter

Programmer
Sep 7, 2003
24
US
I am using Crystal Reports 9

I am creating a report that will show employee output for their shift. We have identified each job by a 3 digit code. What I am having trouble showing is the employee average against the groups average. I need to add the total output for each code for the group and come up with an average for each code. i.e.:

Code HowMany HowLong Average
100 10 100 10 - this would be the employee

100 230 1380 6 - this would be the group

Thanks for any help..

rlporter
 
Once you have the two subtotals, the average is just dividing one subtotal by the other. You could do this at both group levels.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
Thanks for your help, but I'm still unclear.

For the employee have 2 fields, HowMany and HowLong. My code for that is:

{RecordsStats.HowLong} / {RecordsStats.HowMany}

For the group I total the 2 fields for the entire group and sort it by code. The results are called:

Sum of RecordsStats.HowLong
Sum of RecordsStats.HowMany

These are actual fields in the table.

I tried this code:

{Sum Of RecordsStats.HowLong} / {Sum of RecordsStats.HowMany}

but when I checked it, I got an error:

This field name in not known.
 
When you write your formula the subtotals will be listed in the field list, with a blue sigma symbol next to them. Double click these to get the correct syntax for using a subtotal in your formula. It will look something like:

Sum ( {Howmany} , {Groupfield} )

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

Part and Inventory Search

Sponsor

Back
Top