8 Replies Latest reply: May 12, 2015 10:22 AM by Ruben Marin RSS

    Variance Between Table Data - Load

    Jan Pieterse

      Good Day,

       

      I hope you can assist me.

       

      I have the data below:

       

      img.png

       

      I am currently using the below in my loading script but it is giving me an issue:

       

      if(Previous(pin)=pin, Interval(created_at-Previous(created_at),'hh:mm:ss')) as [Travel Time]

       

      I am looking for the variance between data using the "pin" as my reference, the above code works if the data is following each other but not when there is other data in between, as per the example attached, on row 2 the code worked as the same pin was in the previous line, but in row 4 nothing was populated as the pin is different in row 3.

       

      How can I resolve this that the script must look for the previous "pin" = "pin" and ignore the other in between, I will require this for Traveling Time and Distance Traveled?

       

      Any help would be appreciated.

       

      Thank You