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
402da4bb
Commit
402da4bb
authored
Aug 13, 2020
by
yindanlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add fangan_day report codes
parent
98910277
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
create_fangan_day.sql
pm/fangan_day/etl/create_fangan_day.sql
+3
-1
fangan_day.sql
pm/fangan_day/etl/fangan_day.sql
+7
-2
fangan_day.sql
pm/fangan_day/report/fangan_day.sql
+3
-1
No files found.
pm/fangan_day/etl/create_fangan_day.sql
View file @
402da4bb
...
...
@@ -22,7 +22,9 @@ CREATE TABLE IF NOT EXISTS pm.tl_pm_fangan_d
new_DAU
BIGINT
comment
'{"chs_name":"新增DAU","description":"","etl":"","value":"","remark":""}'
,
old_DAU
BIGINT
comment
'{"chs_name":"老活DAU","description":"","etl":"","value":"","remark":""}'
,
quanzhong_DAU
BIGINT
comment
'{"chs_name":"权重日活","description":"","etl":"","value":"","remark":""}'
,
liucun
DOUBLE
comment
'{"chs_name":"次日留存率(%)","description":"","etl":"","value":"","remark":""}'
,
liucun_1
DOUBLE
comment
'{"chs_name":"次日留存率(%)","description":"","etl":"","value":"","remark":""}'
,
liucun_3
DOUBLE
comment
'{"chs_name":"3日留存率(%)","description":"","etl":"","value":"","remark":""}'
,
liucun_7
DOUBLE
comment
'{"chs_name":"7日留存率(%)","description":"","etl":"","value":"","remark":""}'
,
wel_pv
BIGINT
comment
'{"chs_name":"商详PV","description":"","etl":"","value":"","remark":""}'
,
wel_uv
BIGINT
comment
'{"chs_name":"商详UV","description":"","etl":"","value":"","remark":""}'
,
pay_num
BIGINT
comment
'{"chs_name":"支付订单数","description":"","etl":"","value":"","remark":""}'
,
...
...
pm/fangan_day/etl/fangan_day.sql
View file @
402da4bb
...
...
@@ -26,7 +26,9 @@ SELECT t1.partition_date as day_id
+
count
(
DISTINCT
CASE
WHEN
device_type
=
'老活'
AND
device_os_type
=
'ios'
AND
channel_type
=
'医美'
THEN
t1
.
device_id
END
)
*
1
.
00
+
count
(
DISTINCT
CASE
WHEN
device_type
=
'新增'
AND
device_os_type
=
'ios'
AND
channel_type
=
'AI'
THEN
t1
.
device_id
END
)
*
0
.
21
+
count
(
DISTINCT
CASE
WHEN
device_type
=
'新增'
AND
device_os_type
=
'ios'
AND
channel_type
=
'医美'
THEN
t1
.
device_id
END
)
*
0
.
21
,
0
)
as
quanzhong_DAU
,
round
(
sum
(
t1
.
rent_num
)
/
count
(
DISTINCT
t1
.
device_id
)
*
100
,
2
)
as
liucun
,
round
(
sum
(
t1
.
rent1_num
)
/
count
(
DISTINCT
t1
.
device_id
)
*
100
,
2
)
as
liucun_1
,
round
(
sum
(
t1
.
rent3_num
)
/
count
(
DISTINCT
t1
.
device_id
)
*
100
,
2
)
as
liucun_3
,
round
(
sum
(
t1
.
rent7_num
)
/
count
(
DISTINCT
t1
.
device_id
)
*
100
,
2
)
as
liucun_7
,
sum
(
wel_pv
)
as
wel_pv
,
count
(
DISTINCT
CASE
WHEN
wel_pv
is
not
NULL
and
wel_pv
<>
0
THEN
t3
.
cl_id
END
)
as
wel_uv
,
sum
(
pay_num
)
as
pay_num
...
...
@@ -35,7 +37,10 @@ SELECT t1.partition_date as day_id
,
count
(
DISTINCT
t6
.
device_id
)
as
true_valid_dev_num
,
sum
(
t6
.
clue_num
)
as
true_valid_pv
FROM
(
SELECT
t1
.
partition_date
,
t1
.
device_id
,
device_type
,
device_os_type
,
channel_type
,
grey_type
,
count
(
DISTINCT
CASE
WHEN
date_add
(
t1
.
partition_date
,
1
)
=
t
.
partition_date
THEN
t
.
device_id
END
)
as
rent_num
(
SELECT
t1
.
partition_date
,
t1
.
device_id
,
device_type
,
device_os_type
,
channel_type
,
grey_type
,
count
(
DISTINCT
CASE
WHEN
date_add
(
t1
.
partition_date
,
1
)
=
t
.
partition_date
THEN
t
.
device_id
END
)
as
rent1_num
,
count
(
DISTINCT
CASE
WHEN
date_add
(
t1
.
partition_date
,
3
)
=
t
.
partition_date
THEN
t
.
device_id
END
)
as
rent3_num
,
count
(
DISTINCT
CASE
WHEN
date_add
(
t1
.
partition_date
,
7
)
=
t
.
partition_date
THEN
t
.
device_id
END
)
as
rent7_num
FROM
(
---dau数据
SELECT
concat_ws
(
'-'
,
substr
(
partition_date
,
1
,
4
),
substr
(
partition_date
,
5
,
2
),
substr
(
partition_date
,
7
,
2
))
as
partition_date
,
device_id
,
device_os_type
...
...
pm/fangan_day/report/fangan_day.sql
View file @
402da4bb
...
...
@@ -7,7 +7,9 @@ SELECT
,
new_DAU
AS
`新增DAU`
,
old_DAU
AS
`老活DAU`
,
quanzhong_DAU
AS
`权重日活`
,
liucun
AS
`次日留存率(%)`
,
liucun_1
AS
`次日留存率(%)`
,
liucun_3
AS
`3日留存率(%)`
,
liucun_7
AS
`7日留存率(%)`
,
wel_pv
AS
`商详PV`
,
wel_uv
AS
`商详UV`
,
pay_num
AS
`支付订单数`
...
...
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