Commit cab6e802 authored by yindanlei's avatar yindanlei

add icon_function_day report codes

parent 80869331
......@@ -12,11 +12,11 @@ CREATE TEMPORARY FUNCTION convup AS 'com.gmei.hive.common.udf.UDFConvUpgrade';
INSERT OVERWRITE TABLE pm.tl_pm_icon_function_d PARTITION (PARTITION_DAY = ${partition_day})
SELECT t1.partition_date as date `日期`
,t1.grey_type as grey_type `灰度`
SELECT t1.partition_date as date
,t1.grey_type as grey_type
,count(distinct t1.device_id) as dau
,nvl(count(distinct t2.device_id),0) as dau_733 `7.33版本及以上dau`
,nvl(concat(round(count(distinct t2.device_id)/count(distinct t1.device_id)*100,2),'%'),0) as gengxinlv `版本更新率`
,nvl(count(distinct t2.device_id),0) as dau_733
,nvl(concat(round(count(distinct t2.device_id)/count(distinct t1.device_id)*100,2),'%'),0) as gengxinlv
,round(count(DISTINCT CASE WHEN active_type = '老活' AND device_os_type = 'android' AND channel_type = 'AI' THEN t2.device_id END)*0.14
+count(DISTINCT CASE WHEN active_type = '老活' AND device_os_type = 'android' AND channel_type = '医美' THEN t2.device_id END)*0.64
+count(DISTINCT CASE WHEN active_type = '新增' AND device_os_type = 'android' AND channel_type = 'AI' THEN t2.device_id END)*0.08
......@@ -26,39 +26,39 @@ SELECT t1.partition_date as date `日期`
+count(DISTINCT CASE WHEN active_type = '老活' AND device_os_type = 'ios' AND channel_type = '医美' THEN t2.device_id END)*1.00
+count(DISTINCT CASE WHEN active_type = '新增' AND device_os_type = 'ios' AND channel_type = 'AI' THEN t2.device_id END)*0.19
+count(DISTINCT CASE WHEN active_type = '新增' AND device_os_type = 'ios' AND channel_type = '积分墙' THEN t2.device_id END)*0.03
+count(DISTINCT CASE WHEN active_type = '新增' AND device_os_type = 'ios' AND channel_type = '医美' THEN t2.device_id END)*0.57,0) as quanzhong_dau `权重日活`
,nvl(concat(round(count(distinct t3.device_id)/count(distinct t2.device_id)*100,2),'%'),0) as ciliu `次留率`
,nvl(concat(round(sum(t4.click_function_pv)/sum(t4.exp_function_pv)*100,2),'%'),0) as function_click_pv_rate `功能入口点击率PV`
,nvl(concat(round(count(distinct case when t4.click_function_pv>0 then t4.cl_id end)/count(case when t4.exp_function_pv>0 then t4.cl_id end)*100,2),'%'),0) as function_click_uv_rate `功能入口点击率UV`
,nvl(concat(round(sum(t5.click_icon_pv)/sum(t5.exp_icon_pv)*100,2),'%'),0) as icon_click_pv_rate `icon点击率PV`
,nvl(concat(round(count(distinct case when t5.click_icon_pv>0 then t5.cl_id end)/count(case when t5.exp_icon_pv>0 then t5.cl_id end)*100,2),'%'),0) as icon_click_uv_rate `icon点击率UV`
,nvl(concat(round(sum(t7.wel_function_pv)/sum(t7.wel_pv)*100,2),'%'),0) as refer_function_wel_pv_rate `通过功能区到商详页pv占比`
,nvl(concat(round(count(case when t7.wel_function_pv>0 then t7.cl_id end)/count(case when t7.wel_pv>0 then t7.cl_id end)*100,2),'%'),0) as refer_function_wel_uv_rate `通过功能区到商详页uv占比`
,nvl(concat(round(sum(t6.wel_pv)/sum(t7.wel_pv)*100,2),'%'),0) as refer_icon_wel_pv_rate `通过icon到商详页pv占比`
,nvl(concat(round(count(case when t6.wel_pv>0 then t6.cl_id end)/count(case when t7.wel_pv>0 then t7.cl_id end)*100,2),'%'),0) as refer_icon_wel_uv_rate `通过icon到商详页uv占比`
,sum(t4.click_function_pv) as click_function_pv `功能入口点击pv`
,count(distinct case when t4.click_function_pv>0 then t4.cl_id end) as click_function_uv `功能入口点击uv`
,sum(t4.exp_function_pv) as exp_function_pv `功能入口曝光pv`
,count(case when t4.exp_function_pv>0 then t4.cl_id end) as exp_function_uv `功能入口曝光uv`
+count(DISTINCT CASE WHEN active_type = '新增' AND device_os_type = 'ios' AND channel_type = '医美' THEN t2.device_id END)*0.57,0) as quanzhong_dau
,nvl(concat(round(count(distinct t3.device_id)/count(distinct t2.device_id)*100,2),'%'),0) as ciliu
,nvl(concat(round(sum(t4.click_function_pv)/sum(t4.exp_function_pv)*100,2),'%'),0) as function_click_pv_rate
,nvl(concat(round(count(distinct case when t4.click_function_pv>0 then t4.cl_id end)/count(case when t4.exp_function_pv>0 then t4.cl_id end)*100,2),'%'),0) as function_click_uv_rate
,nvl(concat(round(sum(t5.click_icon_pv)/sum(t5.exp_icon_pv)*100,2),'%'),0) as icon_click_pv_rate
,nvl(concat(round(count(distinct case when t5.click_icon_pv>0 then t5.cl_id end)/count(case when t5.exp_icon_pv>0 then t5.cl_id end)*100,2),'%'),0) as icon_click_uv_rate
,nvl(concat(round(sum(t7.wel_function_pv)/sum(t7.wel_pv)*100,2),'%'),0) as refer_function_wel_pv_rate
,nvl(concat(round(count(case when t7.wel_function_pv>0 then t7.cl_id end)/count(case when t7.wel_pv>0 then t7.cl_id end)*100,2),'%'),0) as refer_function_wel_uv_rate
,nvl(concat(round(sum(t6.wel_pv)/sum(t7.wel_pv)*100,2),'%'),0) as refer_icon_wel_pv_rate
,nvl(concat(round(count(case when t6.wel_pv>0 then t6.cl_id end)/count(case when t7.wel_pv>0 then t7.cl_id end)*100,2),'%'),0) as refer_icon_wel_uv_rate
,sum(t4.click_function_pv) as click_function_pv
,count(distinct case when t4.click_function_pv>0 then t4.cl_id end) as click_function_uv
,sum(t4.exp_function_pv) as exp_function_pv
,count(case when t4.exp_function_pv>0 then t4.cl_id end) as exp_function_uv
,sum(t5.click_icon_pv) as click_icon_pv `icon点击pv`
,count(distinct case when t5.click_icon_pv>0 then t5.cl_id end) as click_icon_uv `icon点击uv`
,sum(t5.exp_icon_pv) as exp_icon_pv `icon曝光pv`
,count(case when t5.exp_icon_pv>0 then t5.cl_id end) as exp_icon_uv `icon曝光uv`
,sum(t5.click_icon_pv) as click_icon_pv
,count(distinct case when t5.click_icon_pv>0 then t5.cl_id end) as click_icon_uv
,sum(t5.exp_icon_pv) as exp_icon_pv
,count(case when t5.exp_icon_pv>0 then t5.cl_id end) as exp_icon_uv
,nvl(sum(t7.wel_pv),0) as wel_pv `商详页浏览PV`
,nvl(count(case when t7.wel_pv>0 then t7.cl_id end),0) as wel_uv `商详页浏览UV`
,nvl(sum(t7.wel_function_pv),0) as wel_function_pv `通过功能区到商详页PV`
,nvl(count(case when t7.wel_function_pv>0 then t7.cl_id end),0) as wel_function_uv `通过功能区到商详页UV`
,nvl(sum(t7.wel_pv),0) as wel_pv
,nvl(count(case when t7.wel_pv>0 then t7.cl_id end),0) as wel_uv
,nvl(sum(t7.wel_function_pv),0) as wel_function_pv
,nvl(count(case when t7.wel_function_pv>0 then t7.cl_id end),0) as wel_function_uv
,nvl(sum(t6.wel_pv),0) as wel_icon_pv `通过icon到商详页pv`
,nvl(count(case when t6.wel_pv>0 then t6.cl_id end),0) as wel_icon_uv `通过icon到商详页UV`
,nvl(sum(t6.wel_pv),0) as wel_icon_pv
,nvl(count(case when t6.wel_pv>0 then t6.cl_id end),0) as wel_icon_uv
,nvl(sum(t6.neirong_pv),0) as neirong_icon_pv `通过icon到内容页PV`
,nvl(count(case when t6.neirong_pv>0 then t6.cl_id end),0) as neirong_icon_uv `通过icon到内容页UV`
,nvl(sum(t6.neirong_pv),0) as neirong_icon_pv
,nvl(count(case when t6.neirong_pv>0 then t6.cl_id end),0) as neirong_icon_uv
,nvl(sum(t6.all_pv),0) as all_two_pv `通过icon总二跳PV`
,nvl(count(case when t6.all_pv>0 then t6.cl_id end),0) as all_two_uv `通过icon总二跳UV`
,nvl(sum(t6.all_pv),0) as all_two_pv
,nvl(count(case when t6.all_pv>0 then t6.cl_id end),0) as all_two_uv
from
(
......
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