Skip to content
Advertisement

Diff grouped rows on SQL / AWS Athena and AWS Quicksight

I have this data about user tracking (the user and session is not ordered):

I want to create time spent that difference the rows that grouped by session. My expected result is like this:

I don’t know how to do that on SQL (AWS Athena) or Quicksight.

Advertisement

Answer

You can use lag():

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement