hardapp activity · Q4
sessionizationLAGrunning sum

Sessions per user

Split each user's events into sessions. A new session starts when an event comes more than 30 minutes after that user's previous event. A gap of exactly 30 minutes stays in the same session. The first event of a user always starts a session.

For every user with events, return:

  • sessions, how many sessions they had
  • avg_session_minutes, the average session length in minutes, where a session's length is the time from its first event to its last event (a session with one event is 0 minutes). Round to 1 decimal place.
output columns
user_idsessionsavg_session_minutes

uses

ctrl + enter to run on the sample data · ctrl + shift + enter to submit

run your query to see the output here. Submit checks it against the sample data, hidden test cases, random data and a large dataset.