Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bi-report
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data
bi-report
Commits
cab6e802
Commit
cab6e802
authored
Sep 23, 2020
by
yindanlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add icon_function_day report codes
parent
80869331
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
icon_function_day.sql
pm/home_icon_function_day/etl/icon_function_day.sql
+32
-32
No files found.
pm/home_icon_function_day/etl/icon_function_day.sql
View file @
cab6e802
...
@@ -12,11 +12,11 @@ CREATE TEMPORARY FUNCTION convup AS 'com.gmei.hive.common.udf.UDFConvUpgrade';
...
@@ -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
}
)
INSERT
OVERWRITE
TABLE
pm
.
tl_pm_icon_function_d
PARTITION
(
PARTITION_DAY
=
${
partition_day
}
)
SELECT
t1
.
partition_date
as
date
`日期`
SELECT
t1
.
partition_date
as
date
,
t1
.
grey_type
as
grey_type
`灰度`
,
t1
.
grey_type
as
grey_type
,
count
(
distinct
t1
.
device_id
)
as
dau
,
count
(
distinct
t1
.
device_id
)
as
dau
,
nvl
(
count
(
distinct
t2
.
device_id
),
0
)
as
dau_733
`7.33版本及以上dau`
,
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
`版本更新率`
,
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
,
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
=
'医美'
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
+
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 `日期`
...
@@ -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
=
'医美'
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
=
'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
.
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
`权重日活`
+
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
(
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
(
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
`功能入口点击率UV`
,
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
`icon点击率PV`
,
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
`icon点击率UV`
,
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
`通过功能区到商详页pv占比`
,
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
`通过功能区到商详页uv占比`
,
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
`通过icon到商详页pv占比`
,
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
`通过icon到商详页uv占比`
,
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
`功能入口点击pv`
,
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
`功能入口点击uv`
,
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
`功能入口曝光pv`
,
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
`功能入口曝光uv`
,
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`
,
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
`icon点击uv`
,
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
`icon曝光pv`
,
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
`icon曝光uv`
,
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
(
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
`商详页浏览UV`
,
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
`通过功能区到商详页PV`
,
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
`通过功能区到商详页UV`
,
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
(
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
`通过icon到商详页UV`
,
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
(
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
`通过icon到内容页UV`
,
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
(
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
`通过icon总二跳UV`
,
nvl
(
count
(
case
when
t6
.
all_pv
>
0
then
t6
.
cl_id
end
),
0
)
as
all_two_uv
from
from
(
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment