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

How do I add fields containing formulas with the "min" function? 1

Status
Not open for further replies.

CLogix

MIS
Joined
Feb 14, 2007
Messages
4
Location
US
I have a field that is calculating response time between created date/time and the minimum labor date/time. I need to have a total response time for multiple records to calculate the average response time. This field is not displayed using the summary option.

How can this be accomplished?
 
Use a variable, as in:

whileprintingrecords;
numbervar sumrtime := {sumrtime + @resptime}; //your calc
numbervar cnt := cnt + 1;

Place this formula in the section where you are calculating {@resptime}. Then create a separate formula for the average calculation in the report footer:

whileprintingrecords;
numbervar sumrtime;
numbervar cnt;
sumrtime/cnt;

If you want the average at the group level you will need a reset formula in the group header:

whileprintingrecords;
numbervar sumrtime;
numbervar cnt;
if not inrepeatedgroupheader then(
sumrtime := 0;
cnt := 0
);

-LB
 
In your example it appears that I am still missing the part where I total all @resptime. The response time calculation uses the "min" function for the labor date/time to calculate the reponse time for each workorder. I need to add all of the workorder response times together before calculating the average. The response time formula is not an option in the summarize window.
 
That initial formula should have been:

whileprintingrecords;
numbervar sumrtime := sumrtime + {@resptime}; //your calc
numbervar cnt := cnt + 1;
sumrtime; //add this if you want to see the summation occurring from section to section

This is where the resptime is being summed. Are you saying that {@resptime} formula is not working? Please show the contents of it and indicate in what report section it is located.

-LB
 
OK, I got it to work. I think what threw me off was the {sumrtime + @resptime} in your original response. Restating as sumrtime + {@resptime} in your reply helped out.

Thank you for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top