Commit 4ec63b9c authored by 魏艺敏's avatar 魏艺敏

push codes

parent 2ba52ed6
sign_daily=签到用户质量日报
\ No newline at end of file
sign_daily=签到用户日报
sign_quality=签到质量数据
sign_daily_detail=签到用户质量明细
\ No newline at end of file
......@@ -18,6 +18,7 @@ CREATE TABLE IF NOT EXISTS pm.tl_pm_sign_deepaction_d
(
day_id string comment '{"chs_name":"当天日期","description":"","etl":"","value":"","remark":""}',
device_os_type string comment '{"chs_name":"设备类型","description":"","etl":"","value":"","remark":""}',
active_type string comment '{"chs_name":"活跃类型","description":"","etl":"","value":"","remark":""}',
user_type string comment '{"chs_name":"用户类型","description":"","etl":"","value":"","remark":""}',
active_num bigint comment '{"chs_name":"活跃设备数","description":"","etl":"","value":"","remark":""}',
wel_pv bigint comment '{"chs_name":"商品核心页浏览pv","description":"","etl":"","value":"","remark":""}',
......
......@@ -16,6 +16,7 @@ CREATE TEMPORARY FUNCTION setencryption AS 'com.gmei.hive.common.udf.UDFStringSe
INSERT OVERWRITE TABLE pm.tl_pm_sign_deepaction_d PARTITION (PARTITION_DAY = ${partition_day})
SELECT mas.partition_date as day_id
,device_os_type
,active_type
,case when c.device_id is null then '非签到用户'
when c.sign_date=c.first_sign_date then '首日签到用户'
when c.sign_date>c.first_sign_date then '非首日签到用户' end as user_type
......@@ -29,10 +30,11 @@ FROM
(
SELECT partition_date
,device_os_type
,case when active_type in ('1','2') then '新增' else '老活' end as active_type
,device_id
FROM online.ml_device_day_active_status
WHERE partition_date >= REGEXP_REPLACE(trunc(date_sub(current_date(),1),'MM'),'-','') AND partition_date <=regexp_replace(date_sub(current_date(),1),'-','')
AND active_type IN ('4')
AND active_type IN ('4','1','2')
AND first_channel_source_type not IN ('yqxiu1','yqxiu2','yqxiu3','yqxiu4','yqxiu5','mxyc1','mxyc2','mxyc3'
,'wanpu','jinshan','jx','maimai','zhuoyi','huatian','suopingjingling','mocha','mizhe','meika','lamabang'
,'js-az1','js-az2','js-az3','js-az4','js-az5','jfq-az1','jfq-az2','jfq-az3','jfq-az4','jfq-az5','toufang1'
......@@ -244,9 +246,10 @@ on c.device_id=mas.device_id and c.sign_date=mas.partition_date
group by mas.partition_date
,device_os_type
,active_type
,case when c.device_id is null then '非签到用户'
when c.sign_date=c.first_sign_date then '首日签到用户'
when c.sign_date>c.first_sign_date then '非首日签到用户' end
order by 1,2,3
order by 1,2,3,4
#step3.job
type=command
dependencies=step2
command=curl -X GET http://localhost:8553/api/report/email/sign_daily/zhaoyang@igengmei.com,shenzheng@igengmei.com,zhangwen@igengmei.com/weiyimin@igengmei.com,hanyingyue@igengmei.com
\ No newline at end of file
command=curl -X GET http://localhost:8553/api/report/email/sign_daily/zhaoyang@igengmei.com,shenzheng@igengmei.com/weiyimin@igengmei.com,hanyingyue@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)/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 ('20200731','20200831','20200930','20201031','20201130','20201231',regexp_replace(date_sub(current_date,1),'-',''))
group by day_id
order by `日期`
SELECT day_id as `日期`
,device_os_type as `设备类型`
,active_type as `活跃类型`
,user_type as `用户类型`
,active_num as `活跃设备数`
,wel_pv as `核心页pv`
,wel_uv as `核心页uv`
,clue_pv as `线索pv`
,clue_uv as `线索uv`
FROM pm.tl_pm_sign_deepaction_d_v2
where partition_day in ('20200731','20200831','20200930','20201031','20201130','20201231',regexp_replace(date_sub(current_date,1),'-',''))
order by `日期`,`设备类型`,`活跃类型`,`用户类型`
\ No newline at end of file
SELECT day_id as `日期`
,round((sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' and user_type='非首日签到用户' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' and user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' THEN active_num END)),2) as `单个iOS非首日签到贡献商品核心页PV/单个iOS老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' AND user_type='非首日签到用户' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' AND user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'ios' AND active_type='老活' THEN active_num END)),2) as `单个iOS非首日签到贡献有效线索人次/单个iOS老贡献有效线索人次`
,round((sum(CASE WHEN device_os_type = 'android' AND active_type='老活' AND user_type='非首日签到用户' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'android' AND active_type='老活' and user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'android' AND active_type='老活' THEN wel_pv END)/sum(CASE WHEN device_os_type = 'android' AND active_type='老活' THEN active_num END)),2) as `单个android非首日签到贡献商品核心页PV/单个android老贡献商品核心页PV`
,round((sum(CASE WHEN device_os_type = 'android' AND active_type='老活' AND user_type='非首日签到用户' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'android' AND active_type='老活' AND user_type='非首日签到用户' THEN active_num END))/(sum(CASE WHEN device_os_type = 'android' AND active_type='老活' THEN clue_pv END)/sum(CASE WHEN device_os_type = 'android' AND active_type='老活' THEN active_num END)),2) as `单个android非首日签到贡献有效线索人次/单个android老贡献有效线索人次`
FROM pm.tl_pm_sign_deepaction_d_v2
where partition_day in ('20200731','20200831','20200930','20201031','20201130','20201231',regexp_replace(date_sub(current_date,1),'-',''))
group by day_id
order by `日期`
\ No newline at end of file
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