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
ecc720c1
Commit
ecc720c1
authored
Oct 29, 2020
by
魏艺敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push codes
parent
780be8bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
2 deletions
+75
-2
en-cn.properties
pm/wel_clue_by_channel/en-cn.properties
+3
-2
welfare_by_channel_uv.sql
pm/wel_clue_by_channel/report/welfare_by_channel_uv.sql
+72
-0
No files found.
pm/wel_clue_by_channel/en-cn.properties
View file @
ecc720c1
clue_by_channel
=
线索pv
welfare_by_channel
=
核心页pv
wel_clue_by_channel
=
分渠道3日及7日内核心页和线索pv
\ No newline at end of file
wel_clue_by_channel
=
分渠道3日及7日内核心页和线索pv
welfare_by_channel_uv
=
商详页uv
\ No newline at end of file
pm/wel_clue_by_channel/report/welfare_by_channel_uv.sql
0 → 100644
View file @
ecc720c1
SELECT
first_active_date
as
`日期`
,
channel
as
`渠道`
,
device_os_type
as
`平台`
,
COUNT
(
DISTINCT
device
.
device_id
)
AS
`当天新活量`
,
nvl
(
distinct
(
IF
(
pv
.
action_date
=
device
.
first_active_date
,
pv
.
cl_id
,
NULL
)),
0
)
AS
`当日商详页uv`
,
nvl
(
distinct
(
IF
(
pv
.
action_date
>=
device
.
first_active_date
AND
pv
.
action_date
<=
date_add
(
device
.
first_active_date
,
2
),
pv
.
cl_id
,
NULL
)),
0
)
AS
`3日内商详页uv`
,
nvl
(
distinct
(
IF
(
pv
.
action_date
>=
device
.
first_active_date
AND
pv
.
action_date
<=
date_add
(
device
.
first_active_date
,
6
),
pv
.
cl_id
,
NULL
)),
0
)
AS
`7日内商详页uv`
FROM
(
SELECT
first_active_date
,
device_id
,
device_os_type
,
IF
(
ios_device
.
channel
IS
NOT
NULL
,
ios_device
.
channel
,
first_channel_source_type
)
AS
channel
FROM
(
SELECT
device_id
,
device_os_type
,
first_channel_source_type
,
concat_ws
(
'-'
,
substr
(
partition_date
,
1
,
4
),
substr
(
partition_date
,
5
,
2
),
substr
(
partition_date
,
7
,
2
))
AS
first_active_date
FROM
online
.
ml_device_day_active_status
WHERE
partition_date
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
8
),
'MM'
),
'-'
,
''
)
AND
partition_date
<=
regexp_replace
(
date_sub
(
current_date
(),
1
),
'-'
,
''
)
AND
active_type
in
(
'1'
,
'2'
)
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'
,
'js-az1'
,
'js-az2'
,
'js-az3'
,
'js-az4'
,
'js-az5'
,
'jfq-az1'
,
'jfq-az2'
,
'jfq-az3'
,
'jfq-az4'
,
'jfq-az5'
,
'toufang1'
,
'toufang2'
,
'toufang3'
,
'toufang4'
,
'toufang5'
,
'toufang6'
,
'TF-toufang1'
,
'TF-toufang2'
,
'TF-toufang3'
,
'TF-toufang4'
,
'TF-toufang5'
,
'tf-toufang1'
,
'tf-toufang2'
,
'tf-toufang3'
,
'tf-toufang4'
,
'tf-toufang5'
,
'benzhan'
,
'promotion_aso100'
,
'promotion_qianka'
,
'promotion_xiaoyu'
,
'promotion_dianru'
,
'promotion_malioaso'
,
'promotion_malioaso-shequ'
,
'promotion_shike'
,
'promotion_julang_jl03'
,
'promotion_zuimei'
,
''
,
'unknown'
)
AND
first_channel_source_type
not
like
'promotion
\_
jf
\_
%'
)
device
LEFT
JOIN
(
SELECT
channel
,
idfa
FROM
(
SELECT
channel
,
idfa
,
row_number
()
over
(
PARTITION
BY
idfa
ORDER
BY
active_time
asc
)
rn
--,substr(active_time,1,7) as new_month
FROM
online
.
tl_hdfs_ios_idfa_tmp
--设备表,区分App Store 明细渠道名字
)
a
WHERE
rn
=
1
)
ios_device
ON
ios_device
.
idfa
=
device
.
device_id
GROUP
BY
first_active_date
,
device_id
,
device_os_type
,
IF
(
ios_device
.
channel
IS
NOT
NULL
,
ios_device
.
channel
,
first_channel_source_type
)
)
device
LEFT
JOIN
(
SELECT
action_date
,
cl_id
,
count
(
1
)
as
wel_pv
FROM
(
SELECT
concat_ws
(
'-'
,
substr
(
partition_date
,
0
,
4
),
substr
(
partition_date
,
5
,
2
),
substr
(
partition_date
,
7
,
2
))
AS
action_date
,
cl_id
FROM
online
.
bl_hdfs_maidian_updates
WHERE
partition_date
>=
REGEXP_REPLACE
(
trunc
(
date_sub
(
current_date
(),
8
),
'MM'
),
'-'
,
''
)
AND
partition_date
<=
regexp_replace
(
date_sub
(
current_date
(),
1
),
'-'
,
''
)
AND
page_name
in
(
'welfare_detail'
)
AND
action
=
'page_view'
)
a
LEFT
JOIN
(
-- 2.去掉疑似机构刷量的PV和UV
SELECT
device_id
FROM
ml
.
ml_d_ct_dv_devicespam_d
WHERE
partition_day
=
regexp_replace
(
date_sub
(
current_date
(),
1
),
'-'
,
''
)
)
spam_pv
on
a
.
cl_id
=
spam_pv
.
device_id
WHERE
spam_pv
.
device_id
IS
NULL
GROUP
BY
action_date
,
cl_id
)
pv
ON
device
.
device_id
=
pv
.
cl_id
GROUP
BY
first_active_date
,
channel
,
device_os_type
\ 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