Jump to content

Calculate timespan between rows for single timestamp column


Sydney Thompson 2

Recommended Posts

Hello there!

I am trying to calculate the difference in minutes between rows on a well by well basis. There are between 35-50 rows for each of the different wells and the timestamps span multiple days so I need to be sure I capture the time difference when a new day begins. I have tried to rank the date column and use that for datediff and timespan calcs with no luck. I have also tried using various intersect and over functions. The closest I have been able to get has been to duplicate the date column [DTTMPULL] using this code,First([DTTMPULL]) OVER (Intersect([Ranked DTTMPULL],[WELLNAME],AllNext([DTTMPULL]))) as Previous Date

I have been trying to keep in the same timestamp format for ease. I tried using the DateDiff function and lagging the Previous Date column (really just a duplicate) with no luck - the values are incorrect.DateDiff([DTTMPULL],lag([Previous Date]))

I have also tried doing this same process with a timestamp function which has the same result.

I am obviously not incredibly skilled in spotfire and would appreciate any help - I'm sure I'm overcomplicating the heck out of this. Thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...