Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

running time calculation

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

2 Replies
hic
Former Employee
Former Employee

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

vgutkovsky
Master II
Master II

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