2 Replies Latest reply: Dec 5, 2012 1:47 PM by Henric Cronström RSS

    running time calculation

    steve peroni

      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

        • Re: running time calculation
          Henric Cronström

          I would do a


          Load *,

                    [End Time] - [Start Time] as Duration;




                    [Start Time],

            if(JobID=peek(JobID), peek([Start Time])) as [End Time]

                    resident Table

                    Order By JobID, Step Desc ;


          and then sum the Duration



          • Re: running time calculation
            Vlad Gutkovsky

            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.