Sydney Thompson 2 Posted August 18, 2020 Share Posted August 18, 2020 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 More sharing options...
Fabian Duerr Posted August 18, 2020 Share Posted August 18, 2020 Could you provide some sample data as dxp file/csv/table Link to comment Share on other sites More sharing options...
Sydney Thompson 2 Posted August 18, 2020 Author Share Posted August 18, 2020 Just figured it out! Ranked dates by Wellname, also incorporating month and then subtracted the first date over the lagged date intersecting with wellname. Link to comment Share on other sites More sharing options...
Kirsten Smith (she/her) Posted August 18, 2020 Share Posted August 18, 2020 Just figured it out! Ranked dates by Wellname, also incorporating month and then subtracted the first date over the lagged date intersecting with wellname. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now