Advertisement
YuvalGai

Untitled

Sep 10th, 2024
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. select
  2. interval_date,
  3. activity_day_since_24_08_2022,
  4. SUM(
  5. CASE
  6. WHEN is_ftd = True then 1
  7. else 0
  8. end
  9. ) ftds,
  10. SUM(DAILY_IAP) as Revenue,
  11. count(distinct user_id) as active_users,
  12. count(
  13. distinct case
  14. when lt_purchases_amt > 0 then user_id
  15. end
  16. ) active_paying_users
  17. from
  18. (
  19. SELECT
  20. *,
  21. row_number() over(
  22. partition by user_id
  23. order by
  24. interval_date
  25. ) activity_day_since_24_08_2022
  26. FROM
  27. MATCH_MASTERS.prod.daily_users_from_params
  28. where
  29. interval_date >= '2022-08-24'
  30. and is_active = 1
  31. and first_install_dt >= '2022-08-24'
  32. )
  33. group by
  34. 1,
  35. 2
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement