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!

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

Jobs

crystal reports calculating the average of a calculated field

crystal reports calculating the average of a calculated field

(OP)
I have a Crystal report that I am calculating the dd:hh:mm:ss between order dates to determine turnaround time. My formula name for this is " Individual TAT" as it is the individual turnaround time for each order.

I have a group on company name, and I am trying to do a summary to identify the AVERAGE turnaround for each company group. However, it does not appear I can do a summary on a calculated field. I want to put the average TAT for each company in the group header. See attached screenshot.

Thanks in advance for your assistance.

RE: crystal reports calculating the average of a calculated field

You probably will have to create a formula to 'manually' do the average. Crystal reports will not let you do a summary on a summary normally.

RE: crystal reports calculating the average of a calculated field

You should create a formula that calculates the difference in seconds for each row without converting it to string, e.g.,

//{@diff}:
Datediff("s",{table.receiveddate},{table.approveddate})

Then you can use a separate calculation:
Average({@diff},{table.company})

...in the conversion formula (whatever you used for the row display).

-LB

RE: crystal reports calculating the average of a calculated field

(OP)
Is this what you were suggesting? I am getting an error "The ) is missing" on the (dur section of the days row.

whileprintingrecords;
Average({@Individual TAT},{'request_log__4__'.Agency});
numbervar days;
numberVar hrs;
numberVar min;
numberVar sec;
stringVar ddhhmmss;
days:= Truncate(Truncate(Truncate(dur/60)/60)/24);
hrs := Remainder(Truncate(Truncate(dur/60)/60),24);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

ddhhmmss := totext(days,0,"") + ":" + totext(hrs,"00") + ":" + totext(min,"00") + ":" + totext(sec,"00");

ddhhmmss

RE: crystal reports calculating the average of a calculated field

You left out the variable name assignment in front of the line containing the average:

Numbervar dur := average( etc.

-LB

RE: crystal reports calculating the average of a calculated field

(OP)
Thank you very much. That worked

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!

Resources

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