Skip to content

Instantly share code, notes, and snippets.

View depet's full-sized avatar

Dejan depet

  • Pareto AI
  • London, UK
View GitHub Profile
WITH events AS (
SELECT domain_userid,
network_userid,
collector_tstamp,
page_urlpath,
dvce_type,
user_id,
LAG(collector_tstamp, 1) OVER (PARTITION BY domain_userid ORDER BY collector_tstamp) AS last_event
FROM snowplow_atomic.events
WHERE event = 'page_view'