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
bcd363f6
Commit
bcd363f6
authored
Nov 13, 2020
by
edz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push core
parent
eb0ab10b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
35 deletions
+31
-35
ai_daily.sql
pm/core_daily/report/ai_daily.sql
+0
-0
home_daily.sql
pm/core_daily/report/home_daily.sql
+31
-35
search_daily.sql
pm/core_daily/report/search_daily.sql
+0
-0
No files found.
pm/core_daily/report/ai_daily.sql
View file @
bcd363f6
This diff is collapsed.
Click to expand it.
pm/core_daily/report/home_daily.sql
View file @
bcd363f6
...
...
@@ -2,25 +2,25 @@
--首页内容核心数据
SELECT
partition_date
as
`日期`
,
ios_ym_new_click_uv
/
ios_ym_new_sy_uv
as
`iOS医美新用户首页卡片点击uv/ios医美新用户首页uv`
,
ios_ym_new_good_click
/
ios_ym_new_card_click_uv
as
`iOS医美新用户good click 卡片数uv/iOS医美新用户首页点击卡片数uv`
,
ios_ym_old_click_uv
/
ios_ym_old_sy_uv
as
`iOS医美老用户首页卡片点击uv/iOS医美老用户首页uv`
,
ios_ym_old_good_click
/
ios_ym_old_card_click_uv
as
`iOS医美老用户good click 卡片数uv/iOS医美老用户首页点击卡片数uv`
,
ios_ai_new_click_uv
/
ios_ai_new_sy_uv
as
`iOS AI新用户首页卡片点击uv/iOS AI新用户首页uv`
,
ios_ai_new_good_click
/
ios_ai_new_card_click_uv
as
`iOS AI新用户good click 卡片数uv/iOS AI新用户首页点击卡片数uv`
,
ios_ai_old_click_uv
/
ios_ai_old_sy_uv
as
`iOS AI老用户首页卡片点击uv/iOS AI老用户首页uv`
,
ios_ai_old_good_click
/
ios_ai_old_card_click_uv
as
`iOS AI老用户good click 卡片数uv/iOS AI老用户首页点击卡片数uv`
,
andr_ai_new_click_uv
/
andr_ai_new_sy_uv
as
`AI安卓新用户首页卡片点击uv/AI安卓新用户首页uv`
,
andr_ai_new_good_click
/
andr_ai_new_card_click_uv
as
`AI安卓新用户信息流good click 卡片数uv/AI安卓新用户首页点击卡片数uv`
,
andr_ai_old_click_uv
/
andr_ai_old_sy_uv
as
`AI安卓老用户首页卡片点击uv/AI安卓老用户首页uv`
,
andr_ai_old_good_click
/
andr_ai_old_card_click_uv
as
`AI安卓老用户信息流good click 卡片数uv/AI安卓老用户首页点击卡片数uv`
,
andr_ym_new_click_uv
/
andr_ym_new_sy_uv
as
`安卓医美新用户首页卡片点击uv/安卓医美新用户首页uv`
,
andr_ym_new_good_click
/
andr_ym_new_card_click_uv
as
`安卓医美新用户信息流good click 卡片数uv/安卓医美新用户首页点击卡片数uv`
,
andr_ym_old_click_uv
/
andr_ym_old_sy_uv
as
`安卓医美老用户首页卡片点击uv/安卓医美老用户首页uv`
,
andr_ym_old_good_click
/
andr_ym_old_card_click_uv
as
`安卓医美老用户信息流good click 卡片数uv/安卓医美老用户首页点击卡片数uv`
,
nvl
(
round
(
ios_ym_new_click_uv
/
ios_ym_new_sy_uv
,
2
),
0
)
as
`iOS医美新用户首页卡片点击uv/ios医美新用户首页uv`
,
nvl
(
round
(
ios_ym_new_good_click
/
ios_ym_new_card_click_uv
,
2
),
0
)
as
`iOS医美新用户good click 卡片数uv/iOS医美新用户首页点击卡片数uv`
,
nvl
(
round
(
ios_ym_old_click_uv
/
ios_ym_old_sy_uv
,
2
),
0
)
as
`iOS医美老用户首页卡片点击uv/iOS医美老用户首页uv`
,
nvl
(
round
(
ios_ym_old_good_click
/
ios_ym_old_card_click_uv
,
2
),
0
)
as
`iOS医美老用户good click 卡片数uv/iOS医美老用户首页点击卡片数uv`
,
nvl
(
round
(
ios_ai_new_click_uv
/
ios_ai_new_sy_uv
,
2
),
0
)
as
`iOS AI新用户首页卡片点击uv/iOS AI新用户首页uv`
,
nvl
(
round
(
ios_ai_new_good_click
/
ios_ai_new_card_click_uv
,
2
),
0
)
as
`iOS AI新用户good click 卡片数uv/iOS AI新用户首页点击卡片数uv`
,
nvl
(
round
(
ios_ai_old_click_uv
/
ios_ai_old_sy_uv
,
2
),
0
)
as
`iOS AI老用户首页卡片点击uv/iOS AI老用户首页uv`
,
nvl
(
round
(
ios_ai_old_good_click
/
ios_ai_old_card_click_uv
,
2
),
0
)
as
`iOS AI老用户good click 卡片数uv/iOS AI老用户首页点击卡片数uv`
,
nvl
(
round
(
andr_ai_new_click_uv
/
andr_ai_new_sy_uv
,
2
),
0
)
as
`AI安卓新用户首页卡片点击uv/AI安卓新用户首页uv`
,
nvl
(
round
(
andr_ai_new_good_click
/
andr_ai_new_card_click_uv
,
2
),
0
)
as
`AI安卓新用户信息流good click 卡片数uv/AI安卓新用户首页点击卡片数uv`
,
nvl
(
round
(
andr_ai_old_click_uv
/
andr_ai_old_sy_uv
,
2
),
0
)
as
`AI安卓老用户首页卡片点击uv/AI安卓老用户首页uv`
,
nvl
(
round
(
andr_ai_old_good_click
/
andr_ai_old_card_click_uv
,
2
),
0
)
as
`AI安卓老用户信息流good click 卡片数uv/AI安卓老用户首页点击卡片数uv`
,
nvl
(
round
(
andr_ym_new_click_uv
/
andr_ym_new_sy_uv
,
2
),
0
)
as
`安卓医美新用户首页卡片点击uv/安卓医美新用户首页uv`
,
nvl
(
round
(
andr_ym_new_good_click
/
andr_ym_new_card_click_uv
,
2
),
0
)
as
`安卓医美新用户信息流good click 卡片数uv/安卓医美新用户首页点击卡片数uv`
,
nvl
(
round
(
andr_ym_old_click_uv
/
andr_ym_old_sy_uv
,
2
),
0
)
as
`安卓医美老用户首页卡片点击uv/安卓医美老用户首页uv`
,
nvl
(
round
(
andr_ym_old_good_click
/
andr_ym_old_card_click_uv
,
2
),
0
)
as
`安卓医美老用户信息流good click 卡片数uv/安卓医美老用户首页点击卡片数uv`
FROM
(
...
...
@@ -75,11 +75,9 @@ FROM
LEFT
JOIN
(
SELECT
code
,
is_ai_channel
,
partition_day
FROM
DIM
.
DIM_AI_CHANNEL_ZP_NEW
WHERE
partition_day
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
AND
partition_day
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
))
tmp
WHERE
partition_day
>=
'${start_date}'
AND
partition_day
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
))
tmp
ON
partition_date
=
tmp
.
partition_day
AND
first_channel_source_type
=
code
WHERE
partition_date
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
WHERE
partition_date
>=
'${start_date}'
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
AND
active_type
IN
(
'1'
,
'2'
,
'4'
)
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'
...
...
@@ -105,8 +103,7 @@ FROM
SELECT
concat_ws
(
'-'
,
substr
(
partition_date
,
1
,
4
),
substr
(
partition_date
,
5
,
2
),
substr
(
partition_date
,
7
,
2
))
as
partition_date
,
cl_id
as
device_id
FROM
online
.
bl_hdfs_maidian_updates
where
partition_date
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
where
partition_date
>=
'${start_date}'
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
AND
action
=
'page_view'
AND
page_name
=
'home'
group
by
concat_ws
(
'-'
,
substr
(
partition_date
,
1
,
4
),
substr
(
partition_date
,
5
,
2
),
substr
(
partition_date
,
7
,
2
)),
cl_id
,
params
[
'card_id'
]
...
...
@@ -120,8 +117,7 @@ FROM
,
params
[
'card_id'
]
as
card_id
,
count
(
distinct
array
(
params
[
'card_id'
],
app_session_id
))
as
click_pv
FROM
online
.
bl_hdfs_maidian_updates
where
partition_date
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
where
partition_date
>=
'${start_date}'
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
and
action
=
'on_click_card'
and
page_name
=
'home'
and
params
[
'card_type'
]
=
'card'
...
...
@@ -137,8 +133,7 @@ FROM
,
params
[
'business_id'
]
as
card_id
,
count
(
distinct
array
(
params
[
'card_id'
],
app_session_id
))
as
click_pv
FROM
online
.
bl_hdfs_maidian_updates
where
partition_date
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
where
partition_date
>=
'${start_date}'
and
partition_date
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
and
action
=
'page_view'
and
(
referrer
in
(
'home'
)
or
(
params
[
'referrer_link'
]
like
'%[%'
and
...
...
@@ -160,7 +155,7 @@ FROM
when
page_name
in
(
'post_detail'
,
'user_post_detail'
,
'doctor_post_detail'
)
THEN
'post'
when
page_name
in
(
'answer_detail'
)
THEN
'answer'
end
content_type
FROM
ONLINE
.
BL_HDFS_MAIDIAN_UPDATES
WHERE
PARTITION_DATE
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
WHERE
PARTITION_DATE
>=
'${start_date}'
and
(
referrer
=
'home'
or
(
params
[
'referrer_link'
]
like
'%[%'
and
json_split
(
params
[
'referrer_link'
])[
size
(
json_split
(
params
[
'referrer_link'
]))
-
1
]
=
'home'
))
...
...
@@ -178,7 +173,7 @@ FROM
WHERE
partition_date
=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
AND
is_spam
=
'false'
--排除疑似广告
and
is_online
=
'true'
and
regexp_replace
(
substr
(
reply_date
,
1
,
10
),
'-'
,
''
)
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
and
regexp_replace
(
substr
(
reply_date
,
1
,
10
),
'-'
,
''
)
>=
'${start_date}'
group
by
id
,
problem_id
,
user_id
,
reply_date
)
t1
JOIN
...
...
@@ -202,7 +197,7 @@ FROM
AND
answer_id
is
not
NULL
and
is_online
=
'true'
and
is_spam
=
'false'
--排除疑似广告
and
regexp_replace
(
substr
(
create_time
,
1
,
10
),
'-'
,
''
)
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
and
regexp_replace
(
substr
(
create_time
,
1
,
10
),
'-'
,
''
)
>=
'${start_date}'
group
by
answer_id
,
user_id
,
create_time
UNION
ALL
...
...
@@ -211,7 +206,7 @@ FROM
SELECT
tractate_id
as
content_id
,
'post'
as
type
,
user_id
,
regexp_replace
(
substr
(
create_time
,
1
,
10
),
'-'
,
''
)
as
create_date
FROM
online
.
tl_hdfs_api_tractate_reply_view
WHERE
partition_date
=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
and
regexp_replace
(
substr
(
create_time
,
1
,
10
),
'-'
,
''
)
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
1
),
'MM'
),
'-'
,
''
)
and
regexp_replace
(
substr
(
create_time
,
1
,
10
),
'-'
,
''
)
>=
'${start_date}'
and
is_online
=
'true'
group
by
tractate_id
,
user_id
,
create_time
)
b
...
...
@@ -230,4 +225,5 @@ FROM
on
t4
.
partition_date
=
t5
.
partition_date
and
t4
.
device_id
=
t5
.
cl_id
and
t4
.
card_id
=
t5
.
business_id
WHERE
t2
.
device_id
is
null
group
by
t1
.
partition_date
)
t
\ No newline at end of file
)
t
order
by
`日期`
;
\ No newline at end of file
pm/core_daily/report/search_daily.sql
View file @
bcd363f6
This diff is collapsed.
Click to expand it.
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