SECONDDIFF with to different Sessions

Comments

3 comments

  • Avatar
    Christopher Hols

    Thank you for any advice!

    0
    Comment actions Permalink
  • Avatar
    Tri Anthony Situmorang (Edited )

    Hi Christopher, 

    To do that, you need to modify the table and add a custom column for each record that shows the start time of the next session. You can do a self lookup, follow these steps:

    1. Assuming the SessionStopTime and the SessionStartTime are datetime fields, you can add a custom column (call it SessionRank or anything) to rank the sessions by the user and the start time: RankAsc(User, SessionStartTime).
    2. Add another custom column to get the rank of the next session: SessionRank + 1. Call it NextSessionRank.
    3. Add the last custom column to look up the start time of the next session using the rank columns from the previous steps: lookup(<the name of the table>, SessionStartTime, NextSessionRank, SessionRank). Call it NextSessionStartTime.
    4. You can now perform the seconddiff calculation on the row level: SecondDiff([SessionStopTime],[NextSessionStartTime]) 
    0
    Comment actions Permalink
  • Avatar
    Christopher Hols

    Hello Tri,

     

    for the lookup, which table should I look up? I am currently building this in a custom table. Should I look up the source table or the custom table?

     

    KR and Thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.