Continuing the discussion from Data Explorer Plugin:
For a searchable list of queries in this topic, see @SidV’s query list on GitHub.
This topic has become too long to be easily searched. If you have questions about how to write a Data Explorer query, start a new topic in the #support category and tag it with
data-explorer
.
Here’s a couple I’m starting with:
Users Last Seen Since (Since N Weeks Ago)
with intervals as (
select
n as start_time,
CURRENT_TIMESTAMP as end_time
from generate_series(CURRENT_TIMESTAMP - INTERVAL '140 days',
CURRENT_TIMESTAMP - INTERVAL '7 days',
INTERVAL '7 days') n
)
select
COUNT(1) as users_seen_since,
CURRENT_TIMESTAMP - i.start_time as time_ago
FROM USERS u
right join intervals i
on u.last_seen_at >= i.start_time and u.last_seen_at < i.end_time
group by i.start_time, i.end_time
order by i.start_time desc
Users Last Seen Since (Since N Days Ago)
with intervals as (
select
n as start_time,
CURRENT_TIMESTAMP as end_time
from generate_series(CURRENT_TIMESTAMP - INTERVAL '30 days',
CURRENT_TIMESTAMP - INTERVAL '1 day',
INTERVAL '1 day') n
)
select
COUNT(1) as users_seen_since,
CURRENT_TIMESTAMP - i.start_time as time_ago
FROM USERS u
right join intervals i
on u.last_seen_at >= i.start_time and u.last_seen_at < i.end_time
group by i.start_time, i.end_time
order by i.start_time desc