Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH new_user AS (
- SELECT DISTINCT uid
- FROM stat.funnelTrack
- WHERE dt >= '2025-06-04'
- AND appVersion >= 69550
- AND deviceType = 2
- AND appVersion % 2 = 0
- AND action = 'open_first'
- AND region = 'ru'
- ),
- ax AS (
- SELECT
- ft.action as action,
- uid IN (SELECT uid FROM new_user) AS is_new_user,
- uniqExact(ft.uid) AS users,
- sum(users) over (partition by action) as cohort
- FROM stat.funnelTrack ft
- WHERE ft.dt >= '2025-05-01'
- AND ft.appVersion >= 69550
- AND ft.deviceType = 2
- AND ft.appVersion % 2 = 0
- -- AND ft.action IN ('open_first', 'open', 'app_was_opened')
- AND ft.region = 'ru'
- GROUP BY ft.action, is_new_user
- )
- SELECT *
- FROM ax
- where users >= 20
- ORDER BY cohort DESC, action, is_new_user;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement