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.

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

### 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}:

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.

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!