Advertisement
YuvalGai

Untitled

Jul 16th, 2023
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. CREATE OR REPLACE TABLE CANDIVORE.SEMANTIC_LAYER.T_CONVERSION_RETENION_DASHBOARD AS
  2.  
  3. SELECT date(first_install_dt) first_install_date
  4. , seniority
  5. , seniority_bin
  6. , CASE
  7. WHEN trophies_cnt < 800 THEN '800'
  8. WHEN finish_arena<=13 THEN 'Studios'
  9. WHEN finish_arena<=22 THEN 'Master_League'
  10. WHEN finish_arena>=23 THEN 'Legends_League'
  11. END league
  12. , country
  13. , platform
  14. , media_source
  15. , CAMPAIGN_NAME
  16. , sum(purchases_cnt) as purchases_cnt
  17. , SUM(CASE WHEN is_ftd = True then 1 else 0 end) ftds
  18. , SUM(DAILY_IAP) as Revenue
  19. , count(distinct user_id) as active_users
  20. , sum(daily_match_cnt) daily_match_cnt
  21.  
  22. from CANDIVORE.PROD.DAILY_USERS_FROM_PARAMS where is_active = 1 and first_install_date > '2022-07-01' and is_restored = 0 and user_id not in (select distinct user_id from candivore.prod.f_client_user_login where action = 'reconnected')
  23. group by 1,2,3,4,5,6,7,8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement