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
817b3b60
Commit
817b3b60
authored
Sep 07, 2020
by
魏艺敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push codes
parent
5cd586fc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
daily_operation.sql
pm/daily_operation/etl/daily_operation.sql
+4
-4
daily_operation.sql
pm/daily_operation/report/daily_operation.sql
+3
-3
daily_recommend_strategy.sql
pm/daily_recommend_strategy/etl/daily_recommend_strategy.sql
+0
-0
home_recommend_strategy.sql
...ily_recommend_strategy/report/home_recommend_strategy.sql
+4
-1
No files found.
pm/daily_operation/etl/daily_operation.sql
View file @
817b3b60
...
...
@@ -81,7 +81,7 @@ INSERT OVERWRITE TABLE pm.tl_pm_channel_d PARTITION (PARTITION_DAY = ${partition
INSERT
OVERWRITE
TABLE
pm
.
tl_pm_operation_d
PARTITION
(
PARTITION_DAY
=
${
partition_day
}
)
SELECT
t
1
.
partition_date
as
day_id
SELECT
t
concat_ws
(
'-'
,
substr
(
t1
.
partition_date
,
1
,
4
),
substr
(
t1
.
partition_date
,
5
,
2
),
substr
(
t1
.
partition_date
,
7
,
2
))
as
day_id
,
t1
.
device_os_type
as
device_os_type
,
t1
.
device_type
as
active_type
,
t1
.
channel
as
channel
...
...
@@ -509,8 +509,8 @@ LEFT JOIN
AND
page_code
=
'home'
AND
is_exposure
=
'1'
AND
tab_code
=
'精选'
AND
(
params
[
'transaction_type'
]
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'hotspot_feed'
,
'aistragegy'
,
'excestragegy'
,
'fixedstragegy'
,
'fixedstragegy_video
'
)
or
params
[
'transaction_type'
]
like
'%ctr'
or
params
[
'transaction_type'
]
like
'%cvr'
)
AND
(
transaction_type
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'hotspot_feed'
,
'aistragegy'
,
'excestragegy'
,
'fixedstragegy'
,
'fixedstragegy_video'
,
'deeplink_strategy
'
)
or
transaction_type
like
'%ctr'
or
transaction_type
like
'%cvr'
)
AND
action
in
(
'page_precise_exposure'
,
'home_choiceness_card_exposure'
)
--7745版本action改为page_precise_exposure
AND
card_content_type
in
(
'user_post'
,
'diary'
,
'qa'
,
'answer'
)
)
t1
...
...
@@ -589,7 +589,7 @@ LEFT JOIN
AND
action
=
'on_click_card'
AND
page_code
=
'home'
AND
tab_code
=
'精选'
AND
(
transaction_type
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'hotspot_feed'
,
'aistragegy'
,
'excestragegy'
,
'fixedstragegy'
,
'fixedstragegy_video'
)
AND
(
transaction_type
in
(
'-1'
,
'smr'
,
'hotspot'
,
'pgc'
,
'newdata'
,
'hotspot_feed'
,
'aistragegy'
,
'excestragegy'
,
'fixedstragegy'
,
'fixedstragegy_video'
,
'deeplink_strategy'
)
or
transaction_type
like
'%ctr'
or
transaction_type
like
'%cvr'
)
AND
card_content_type
in
(
'diary'
,
'user_post'
,
'qa'
,
'answer'
)
)
t1
...
...
pm/daily_operation/report/daily_operation.sql
View file @
817b3b60
SELECT
FROM_UNIXTIME
(
UNIX_TIMESTAMP
(
day_id
,
'yyyymmdd'
),
'yyyy-mm-dd'
)
`日期`
SELECT
day_id
`日期`
,
device_os_type
`系统`
,
active_type
`新老`
,
channel
`渠道`
...
...
@@ -70,7 +70,7 @@ SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(day_id,'yyyymmdd'),'yyyy-mm-dd') `日期`
,
nvl
(
wel_second_pv_in_neirongPV
,
0
)
as
`来自内容页的商业二跳/内容pv`
,
nvl
(
neirong_second_pv_in_neirongPV
,
0
)
as
`来自内容页的内容二跳/内容pv`
FROM
pm
.
tl_pm_operation_d
where
((
partition_day
=
'20200
824'
and
day_id
<=
'20200726
'
)
or
(
partition_day
<
regexp_replace
(
date_sub
(
current_date
,
1
),
'-'
,
''
)
and
partition_day
>
'20200
824
'
and
day_id
=
regexp_replace
(
date_sub
(
FROM_UNIXTIME
(
UNIX_TIMESTAMP
(
partition_day
,
'yyyymmdd'
),
'yyyy-mm-dd'
),
29
),
'-'
,
''
))
where
((
partition_day
=
'20200
906'
and
day_id
<=
'20200808
'
)
or
(
partition_day
<
regexp_replace
(
date_sub
(
current_date
,
1
),
'-'
,
''
)
and
partition_day
>
'20200
906
'
and
day_id
=
regexp_replace
(
date_sub
(
FROM_UNIXTIME
(
UNIX_TIMESTAMP
(
partition_day
,
'yyyymmdd'
),
'yyyy-mm-dd'
),
29
),
'-'
,
''
))
or
(
partition_day
=
regexp_replace
(
date_sub
(
current_date
,
1
),
'-'
,
''
)
and
day_id
>=
regexp_replace
(
date_sub
(
current_date
,
30
),
'-'
,
''
)))
order
by
`日期`
,
`系统`
,
`新老`
,
`渠道`
pm/daily_recommend_strategy/etl/daily_recommend_strategy.sql
View file @
817b3b60
This diff is collapsed.
Click to expand it.
pm/daily_recommend_strategy/report/home_recommend_strategy.sql
View file @
817b3b60
...
...
@@ -18,6 +18,8 @@ SELECT
recommend_content_card
as
`来自I的推荐内容点击pv`
,
-- '未配置' as `来自I的推荐专题点击pv`,
transfer_card
as
`来自I的转诊点击pv`
,
video_consultation
as
`来自I的视频面诊点击pv`
FROM
pm
.
tl_pm_recommend_strategy_d
video_consultation
as
`来自I的视频面诊点击pv`
if
(
total_post_pv
-
post_click_pv
>=
0
,
total_post_pv
-
post_click_pv
,
0
)
as
`帖子页链接点击pv(近似值)`
FROM
pm
.
tl_pm_recommend_strategy_d
WHERE
partition_day
>=
'20200824'
and
partition_day
<=
regexp_replace
(
DATE_SUB
(
current_date
,
1
)
,
'-'
,
''
)
order
by
`日期`
desc
,
`设备类型`
,
`活跃类型`
,
`卡片类型`
,
`推荐类型`
;
\ No newline at end of file
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