Commit e1bb70f4 authored by 魏艺敏's avatar 魏艺敏

push codes

parent 3d61b15d
......@@ -22,7 +22,8 @@ CREATE TABLE IF NOT EXISTS pm.tl_pm_sign_deepaction_d
active_num bigint comment '{"chs_name":"活跃设备数","description":"","etl":"","value":"","remark":""}',
wel_pv bigint comment '{"chs_name":"商品核心页浏览pv","description":"","etl":"","value":"","remark":""}',
wel_uv bigint comment '{"chs_name":"商品核心页浏览uv","description":"","etl":"","value":"","remark":""}',
clue_num bigint comment '{"chs_name":"有效线索人次","description":"","etl":"","value":"","remark":""}'
clue_pv bigint comment '{"chs_name":"有效线索人次","description":"","etl":"","value":"","remark":""}',
clue_uv bigint comment '{"chs_name":"有效线索人次","description":"","etl":"","value":"","remark":""}'
)comment '签到用户质量日报'
PARTITIONED BY (PARTITION_DAY STRING comment '分区日期')
ROW FORMAT DELIMITED
......
......@@ -22,7 +22,9 @@ SELECT mas.partition_date as day_id
,count(distinct mas.device_id) as active_num
,sum(wel_pv) as wel_pv
,count(distinct case when wel_pv <> 0 then a.cl_id end) as wel_uv
,sum(CASE WHEN b.device_id is NOT NULL THEN b.valid_pv END) as clue_num
,sum(CASE WHEN b.device_id is NOT NULL THEN b.valid_pv END) as clue_pv
,count(distinct case when valid_pv <> 0 then b.device_id end) as clue_uv
FROM
(
SELECT partition_date
......
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/clue_daily/liudi@igengmei.com,wangxin@igengmei.com,zhaoyang@igengmei.com/weiyimin@igengmei.com
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/email/clue_daily/zhaoyang@igengmei.com/weiyimin@igengmei.com
\ No newline at end of file
SELECT day_id as `日期`
,round((sum(CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'ios' and user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'ios' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'ios' THEN mas.device_id END)),2) as `单个iOS非首日签到贡献商品核心页PV/单个iOS老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN clue_num END)/count(distinct CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'ios' AND b.device_id is NOT NULL THEN b.valid_pv END)/count(distinct CASE WHEN device_os_type = 'ios' THEN mas.device_id END)),2) as `单个iOS非首日签到贡献有效线索人次/单个iOS老贡献有效线索人次`
,round((sum(CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'android' and user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'android' THEN wel_pv END)/count(distinct CASE WHEN device_os_type = 'android' THEN mas.device_id END)),2) as `单个android非首日签到贡献商品核心页PV/单个android老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN clue_num END)/count(distinct CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN mas.device_id END))/(sum(CASE WHEN device_os_type = 'android' AND b.device_id is NOT NULL THEN b.valid_pv END)/count(distinct CASE WHEN device_os_type = 'android' THEN mas.device_id END)),2) as `单个android非首日签到贡献有效线索人次/单个android老贡献有效线索人次`
,round((sum(CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'ios' and user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'ios' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'ios' THEN active_num END)),2) as `单个iOS非首日签到贡献商品核心页PV/单个iOS老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'ios' AND user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'ios' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'ios' THEN active_num END)),2) as `单个iOS非首日签到贡献有效线索人次/单个iOS老贡献有效线索人次`
,round((sum(CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'android' and user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'android' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'android' THEN active_num END)),2) as `单个android非首日签到贡献商品核心页PV/单个android老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'android' AND user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'android' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'android' THEN active_num END)),2) as `单个android非首日签到贡献有效线索人次/单个android老贡献有效线索人次`
FROM pm.tl_pm_sign_deepaction_d
where partition_day in ('20200901','202001001','20201101','20201201','20210101',regexp_replace(date_sub(current_date,1),'-',''))
order by `日期`,`系统`,`新老`,`是否灰度`
group by day_id
order by `日期`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment