Print Page | Close Window

Average Response Times

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4502
Printed Date: 18 May 2024 at 8:06am


Topic: Average Response Times
Posted By: ranman
Subject: Average Response Times
Date Posted: 09 Oct 2008 at 7:22pm
I made a crystal report in Crystal  X1 with a time dispatched and arrival time.  What formula do I use to get the total difference between each time, and then a TOTAL average at the end of the page or report?



Replies:
Posted By: hilfy
Date Posted: 13 Oct 2008 at 11:26am
Assuming that your fields are datetime fields, you can use the DateDiff and Average functions to help with this.
 
Create a formula that looks like this:
Average(DateDif('n', {table.DispatchTime}, {table.ArriveTime}))
 
This will give you the average number of minutes difference between the two times.
 
If you want to show this in hours and minutes, you'll need to create a second formula that references the first (which I'll call mailto:%7b@AveMinutes - {@AveMinutes }):
 
ToText(( mailto:%7b@AveMinutes%7d\60 - {@AveMinutes}\60 ), 0) + ":" + ToText(( mailto:%7b@AveMinutes - {@AveMinutes }) mod 60), "00") 
 
Notice that I used a back-slash in the first calculation ('\' instead of '/').  This is the "Integer Divide" operator that gives you the integer part of the division result.
 
-Dell
 


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: ranman
Date Posted: 07 Nov 2008 at 4:53pm
Thanks for the help.



Print Page | Close Window