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
0b945c78
Commit
0b945c78
authored
Nov 14, 2020
by
魏艺敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push codes
parent
8005fe7a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
home_content_retention.sql
pm/daily_content/report/home_content_retention.sql
+4
-2
daily_grey_recommend.sql
pm/daily_grey_recommend/etl/daily_grey_recommend.sql
+2
-1
home_grey_recommend.sql
pm/daily_grey_recommend/report/home_grey_recommend.sql
+4
-3
No files found.
pm/daily_content/report/home_content_retention.sql
View file @
0b945c78
...
...
@@ -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
pm/daily_grey_recommend/etl/daily_grey_recommend.sql
View file @
0b945c78
...
...
@@ -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%'
...
...
pm/daily_grey_recommend/report/home_grey_recommend.sql
View file @
0b945c78
...
...
@@ -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
)
,
'-'
,
''
))
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