Report not found

There was a problem finding this report.
Average Session Length
March 19, 2015 · Refreshed about 2 months ago
Description
The average length of a session, in seconds.

Collaborators

Run History
SELECT COUNT(*) AS sessions, AVG(length) AS average_session_length FROM ( SELECT global_session_id, EXTRACT('SECOND' FROM MAX(occurred_at) - MIN(occurred_at)) AS length FROM ( SELECT user_id, occurred_at, SUM(is_new_session) OVER (ORDER BY user_id, occurred_at) AS global_session_id, SUM(is_new_session) OVER (PARTITION BY user_id ORDER BY occurred_at) AS user_session_id FROM ( SELECT *, CASE WHEN EXTRACT('EPOCH' FROM occurred_at) - EXTRACT('EPOCH' FROM last_event) >= (60 * 10) OR last_event IS NULL THEN 1 ELSE 0 END AS is_new_session FROM ( SELECT user_id, occurred_at, LAG(occurred_at,1) OVER (PARTITION BY user_id ORDER BY occurred_at) AS last_event FROM tutorial.playbook_events ) last ) final ) session GROUP BY 1 ) agg
SELECT COUNT(*) AS sessions, AVG(length) AS average_session_length FROM ( SELECT global_session_id, EXTRACT('SECOND' FROM MAX(occurred_at) - MIN(occurred_at)) AS length FROM ( SELECT user_id, occurred_at, SUM(is_new_session) OVER (ORDER BY user_id, occurred_at) AS global_session_id, SUM(is_new_session) OVER (PARTITION BY user_id ORDER BY occurred_at) AS user_session_id FROM ( SELECT *, CASE WHEN EXTRACT('EPOCH' FROM occurred_at) - EXTRACT('EPOCH' FROM last_event) >= (60 * 10) OR last_event IS NULL THEN 1 ELSE 0 END AS is_new_session FROM ( SELECT user_id, occurred_at, LAG(occurred_at,1) OVER (PARTITION BY user_id ORDER BY occurred_at) AS last_event FROM tutorial.playbook_events ) last ) final ) session GROUP BY 1 ) agg
<div class="mode-header embed-hidden"> <h1>{{ title }}</h1> <p>{{ description }}</p> </div> <div class="container mode-grid"> <div class="row"> <div class="col-md-12"> <mode-table id="table_e3d13fef3146" dataset="dataset" options="table_options"></mode-table> </div> </div> </div>
{{ dataSourceName(params.queryId) }}

The dataset is too large to view in browser

Export

Looks like something went wrong with your query.

{{ DS.queryRuns[params.queryId].errorMessage }}
This query was cancelled