Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
I don't know how to calculate the time of a process. I've the following DB table:
JobID Step Start Time
XYZ 010 08:52:00
XYZ 050 08:54:10
XYZ 080 08:55:20
I need to calculate the total time for the process: in this case 3 minutes and 20 seconds.
I decided to order records by JobID and Step but how can I do the time calculation ?
Help please
Thanks in advance for your help
I would do a
Load *,
[End Time] - [Start Time] as Duration;
Load
JobID,
Step,
[Start Time],
if(JobID=peek(JobID), peek([Start Time])) as [End Time]
resident Table
Order By JobID, Step Desc ;
and then sum the Duration
HIC
The easiest way is to create a helper field in the script that would tell you the interval between each step. See attached. This assumes that Step 080 represents the end step (meaning, we don't know when it finishes, so I assume 080 = finish). It also assumes that the jobs run sequentially and not in parallel.
Regards,
Vlad