Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WITH
- c_ids AS ( -- UID Родителей, ID Детей, Целевые дети
- SELECT
- uid,
- json_data.2 AS children_id,
- json_data.3 AS children_status
- FROM
- analytics.parent_properties
- ARRAY JOIN
- children AS json_data
- WHERE last_active_datetime >= '2024-09-01'
- and is_full_register
- ),
- c_prop AS ( -- UID Родителей, UID Детей, ID Детей, Целевые дети Android
- SELECT
- cid.uid AS parent_uid,
- cid.children_id AS child_id,
- cp.uid AS child_uid
- FROM
- c_ids cid
- JOIN
- analytics.child_properties cp ON cid.children_id = cp.id
- WHERE
- cp.platform = 'iOS'
- )
- SELECT
- `action`,
- dt,
- count(*) AS events,
- uniqCombined(uid) AS users
- FROM stat.funnelTrack JOIN (SELECT DISTINCT child_uid AS uid FROM c_prop) t1 USING (uid)
- WHERE dt >= '2024-09-01'
- AND dt <= '2024-12-01'
- -- AND `action` = 'permission_submit_click'
- AND `action` IN ('mdm_config_screen_show', 'mdm_manage_screen_show', 'mdm_screen_show', 'mdm_config_screen_click', 'mdm_manage_screen_click', 'mdm_config_screen_click_download_again')
- GROUP BY 1, 2
- ORDER BY 2,1,3 DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement