Commit 0b945c78 authored by 魏艺敏's avatar 魏艺敏

push codes

parent 8005fe7a
......@@ -12,7 +12,8 @@ select substr(day_id,1,6) `日期`
,concat(round(avg(if(home_good_click_retention_quality=0,NULL,home_good_click_retention_quality))*100,2),'%') as `当天点击首页feed卡片,且次日依旧点击的次留率/全站次留率`
FROM pm.tl_pm_content_retention
where ((partition_day='20201110' and day_id<='20201109')
or (partition_day>'20201110' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id=REGEXP_REPLACE(date_sub(concat_ws('-',substr(partition_day,1,4),substr(partition_day,5,2),substr(partition_day,7,2)),1), '-', '')))
or (partition_day>'20201110' and partition_day<regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id=REGEXP_REPLACE(date_sub(concat_ws('-',substr(partition_day,1,4),substr(partition_day,5,2),substr(partition_day,7,2)),1), '-', ''))
or partition_day=regexp_replace(DATE_SUB(current_date,1) ,'-',''))
group by substr(day_id,1,6),device_os_type,active_type,channel
order by `日期`,`系统`,`活跃`,`渠道`
\ No newline at end of file
......@@ -44,7 +44,8 @@ from
,m.device_id,device_os_type
,case when active_type in ('1','2') then '新增设备'
when active_type ='4' then '老活跃设备' end as active_type
,array(case when (partition_date>='20201024' and substr(convup(setencryption(m.device_id,'sha-1'),16,10),-2,2)%20 in (5,6,7,8)) then '灰度' else '非灰' end,'合计') as grey_type
,array(case when ((partition_date>='20201024' and partition_date<='20201113' and substr(convup(setencryption(m.device_id,'sha-1'),16,10),-2,2)%20 in (5,6,7,8))
or (partition_date>='20201114' and substr(convup(setencryption(m.device_id,'sha-1'),16,10),-2,2)%20 in (0,1,2,3,4,5,6,7,8,9)))then '灰度' else '非灰' end,'合计') as grey_type
,array(CASE WHEN (a.device_id is not null or b.device_id is not null
or first_channel_source_type like '%xinyouxingkong%'
or first_channel_source_type like '%jingmeng%'
......
......@@ -19,6 +19,7 @@ SELECT day_id as `日期`
,home_cardclick_uv_in_home_uv as `首页卡片点击uv/首页uv`
,home_goodclick_uv_in_homeclick_uv as `good click卡片数uv/首页点击卡片数uv`
from pm.tl_pm_grey_recommend_d
where ((partition_day='20201112' and day_id<='20201111')
or (partition_day>'20201112' and partition_day<=regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id=date_sub(concat_ws('-',substr(partition_day,1,4),substr(partition_day,5,2),substr(partition_day,7,2)),1)))
where ((partition_day='20201112' and day_id<='2020-11-11')
or (partition_day>'20201112' and partition_day<regexp_replace(DATE_SUB(current_date,1) ,'-','')
and day_id=date_sub(concat_ws('-',substr(partition_day,1,4),substr(partition_day,5,2),substr(partition_day,7,2)),1))
or partition_day=regexp_replace(DATE_SUB(current_date,1) ,'-',''))
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