Skip to content

Instantly share code, notes, and snippets.

@Mr--John-Doe
Created February 12, 2022 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mr--John-Doe/9831297df674343865f31a432c282d6b to your computer and use it in GitHub Desktop.
Save Mr--John-Doe/9831297df674343865f31a432c282d6b to your computer and use it in GitHub Desktop.
SELECT username
, account_id
, session_id
, ip_address
, country_id
, website_entry_point
, payment_platform
, platform_type
, session_duration_s
, number_sold_items
, sales_gbp
FROM SALES.SALES_SESSION_AGGREGATION
WHERE is_meaningful_visit = TRUE
QUALIFY ROW_NUMBER() OVER (PARTITION BY account_id ORDER BY login_ts) = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment