Contact US

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!

*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

Chart Average vs Calculated Average

Chart Average vs Calculated Average

Chart Average vs Calculated Average

I'm using Crystal Reports 2011
I calculate an average Machine Utilization based on the number of available hours vs. number of hours worked for a given time period and group it by Machine (workcenter). The calculation checks out but when I try to chart the daily utilization and average (by group) it over the date range selected the chart shows a different number than the calculated average. Anyone ever come across this problem?
If needed I can post the formulas I'm using.
Thanks for your help.

RE: Chart Average vs Calculated Average

I think you would have to show your formulas to tease this out. I wonder if the chart group is averaging all values versus averaging the values per day. You should also explain your chart setup.


RE: Chart Average vs Calculated Average



but when I try to chart the daily utilization and average (by group)

What do you mean by “the daily utilization” vs. “average (by group)?”

One one hand you have HOURS (0-24) while on the other you have a percentage (0-1)?


glassesJust traded in my OLD subtlety...
for a NUance!tongue

"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein

RE: Chart Average vs Calculated Average

I figured you'd need to see the formulas. I'll start with how I calculate the Utilization for each day.


if (Sum ({@WCHoursWorkedLine},({Transaction_Data.Transaction_Start}))=0)
then 0
(Sum ({@WCHoursWorkedLine},({Transaction_Data.Transaction_Start}))/({@WCCapicity}))*100 

This is total hours worked for the day


DateDiff ('h',{Transaction_Data.Transaction_Start} ,{Transaction_Data.Transaction_End} ) 

This is Workcenter capacity for the day


if (DatePart ("h",{Transaction_Data.Transaction_Start}))>= 15 and {@WCHoursWorkedLine}>2.5
then 16
if (DatePart ("h",{Transaction_Data.Transaction_Start}))>= 14 and {@WCHoursWorkedLine}>3.5
then 16
if ({@WCHoursWorkedLine})>10 and
({Transaction_Data.Employee}) in ["396","044","378","049"]
then 8
else 8 

The chart is structured as follows:
On Change of:
Workcenter (Group1)

Show Value:
Avg of @Utilization

The calculated average is done with the formulas below:

This is Hours Worked
Sum of {@WCHoursWorkedLine}

This is Workcenter Capacity:



Global numbervar newtotalvar; 

This is Workcenter Capacity for the day:


shared numbervar WCC :=
if (Sum ({@WCHoursWorkedLine}, {Transaction_Data.Transaction_Start}))>10 and
({Transaction_Data.Employee}) in ["396","044","378","049"]
then 16
else 8 

This is the Calculated average for the day:


if (Sum ({@WCHoursWorkedLine}, {Work_Center.Work_Center}))=0
then 0
(Sum ({@WCHoursWorkedLine}, {Work_Center.Work_Center})/{@GrandTotWCCap})*100 

Thought I should mention that Group2 is Transaction Start Date
The Chart is in the report footer.

Thanks for your help and let me know if you need any more information.

RE: Chart Average vs Calculated Average

All of your nested formulas are just too confusing for me. I think the issue might be that your utilization formula is per day, while your calculated average is per work center (across days), so not sure why you are calling that the calculated average for the day. You might try adding in the group per day as a second on change of field either as the higher order one or the lower order one, and see if the results make more sense to you.


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