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

CR Averaging a minimum calculated field

Status
Not open for further replies.

arcangelca

Technical User
Nov 3, 2004
4
CA
Hi All,
Hoping someone here can help me out. I have a couple of hundred thousand dispatch records and I'm trying to figure out the average response time for each of our job classifications. My records are like this:

Job1 Unit1 Priority Received date/time atscene date/time clear date/time
job1 Unit2 Priority Received date/time atscene date/time clear date/time
job2 Unit1 Priority Received date/time atscene date/time clear date/time
job2 Unit2 Priority Received date/time atscene date/time clear date/time
job2 Unit3 Priority Received date/time atscene date/time clear date/time
etc....

I first need to figure out the time difference between the the received date/time and atscene date/time because I only care about the first person at the job, if other workers showed up afterwards i'm not interested in the record.

I was grouping the records by priority, then by job and calculating the datediff between received and atscene to give me my mins. I was then summarizing by job to give me the minimum of each of the times. I've gotten to that part, but now that I want to average out the minimums by the priority group it won't let me, saying that field can't be summarized.
Would anybody else have any other suggestions how I do this?

Any help would be appreciated.

Mike

 
YOu need to use variables

in Priority Header

@reset
whileprintingrecords;

global numbervar jobcount:=0;

global numbervar mintime:=0;

In job footer or where summary is calculated

@eval
whileprintingrecords;

global numbervar jobcount:=jobcount+1;

global numbervar mintime:=mintime+minimum(@timediff, jobfield);


in Priority Footer

@display
whileprintingrecords;

global numbervar mintime/global numbervar jobcount;


Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top