2 Replies Latest reply: Jul 26, 2013 10:47 AM by John Sakalis RSS

    Calculate the days difference between a row and its previous

      Hi there,

       

      I have a list of orders, the status they changed into and the date of the stauts change. I want to calculate the days that each order stayed in each status.

      In other words the last column in the table below (the one with the red header text).

       

      Is it better to do it in load time or in a straigh table for example using set analysis?

       

      Thank you all in advance.

       

      Order IdDateStatus Description# of Days is Status
      115/7/2013Approved1
      116/7/2013Awaiting9
      125/7/2013Processing0
      125/7/2013Finished0
      215/7/2013Approved6
      221/7/2013Awaiting4
      225/7/2013Processing0
      225/7/2013Finished0
      316/7/2013Approved5
      321/7/2013Awaiting4
      325/7/2013Processing2
      327/7/2013Finished0
      410/7/2013Approved0
      410/7/2013Awaiting15
      425/7/2013Processing1
      426/7/2013Finished0
      525/6/2013Approved15
      510/7/2013Awaiting7
      517/7/2013Processing4
      521/7/2013Finished0