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
ae505222
Commit
ae505222
authored
Nov 16, 2020
by
edz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
push channel_pay_7_30.zip
parent
ef4016f8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
0 deletions
+89
-0
en-cn.properties
pm/channel_pay_7_30/en-cn.properties
+1
-0
channel_pay_7_30.zip
pm/channel_pay_7_30/job/channel_pay_7_30.zip
+0
-0
step1_1.job
pm/channel_pay_7_30/job/step1_1.job
+4
-0
step1_2.job
pm/channel_pay_7_30/job/step1_2.job
+4
-0
step1_3.job
pm/channel_pay_7_30/job/step1_3.job
+3
-0
step2.job
pm/channel_pay_7_30/job/step2.job
+5
-0
channel_pay.sql
pm/channel_pay_7_30/report/channel_pay.sql
+72
-0
No files found.
pm/channel_pay_7_30/en-cn.properties
0 → 100644
View file @
ae505222
channel_pay_7_30
=
新增用户支付数据-分渠道
pm/channel_pay_7_30/job/channel_pay_7_30.zip
0 → 100644
View file @
ae505222
File added
pm/channel_pay_7_30/job/step1_1.job
0 → 100644
View file @
ae505222
#step1_1.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online tl_hdfs_ios_idfa_tmp
\ No newline at end of file
pm/channel_pay_7_30/job/step1_2.job
0 → 100644
View file @
ae505222
#step1_2.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_device_day_active_status
\ No newline at end of file
pm/channel_pay_7_30/job/step1_3.job
0 → 100644
View file @
ae505222
#step1_3.job
type=command
command=sh /home/bi/bi-report/lib/shell/waitsuccess.sh hive online ml_trade_order_detail_day
pm/channel_pay_7_30/job/step2.job
0 → 100644
View file @
ae505222
#step2.job
type=command
dependencies=step1_1,step1_2,step1_3
command=curl -X GET http://localhost:8553/api/report/email/channel_pay_7_30/hanyingyue@igengmei.com/weiyimin@igengmei.com
\ No newline at end of file
pm/channel_pay_7_30/report/channel_pay.sql
0 → 100644
View file @
ae505222
--新增用户支付分渠道数据
SELECT
partition_date
as
`日期`
,
device_os_type
as
`设备`
,
channel
as
`渠道`
,
sum
(
order_num_7
)
`7天内支付订单量`
,
sum
(
order_num_30
)
`30天内支付订单量`
-- ,sum(order_num_90)`90天内支付订单量`
-- ,sum(dev_num_30)`30天内支付设备数(设备数当天去重,按月加总时不去重)`
-- ,sum(dev_num_60)`60天内支付设备数(设备数当天去重,按月加总时不去重)`
-- ,sum(dev_num_90)`90天内支付设备数(设备数当天去重,按月加总时不去重)`
,
sum
(
gmv_7
)
`7天内支付订单额`
,
sum
(
gmv_30
)
`30天内支付订单额`
-- ,sum(gmv_90)`90天内支付订单额`
FROM
(
SELECT
mas
.
partition_date
,
device_os_type
,
channel
,
nvl
(
sum
(
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
7
)
then
order_num
end
),
0
)
as
order_num_7
,
nvl
(
sum
(
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
30
)
then
order_num
end
),
0
)
as
order_num_30
,
nvl
(
sum
(
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
90
)
then
order_num
end
),
0
)
as
order_num_90
,
nvl
(
count
(
distinct
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
7
)
then
a
.
device_id
end
),
0
)
as
dev_num_7
,
nvl
(
count
(
distinct
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
30
)
then
a
.
device_id
end
),
0
)
as
dev_num_30
,
nvl
(
count
(
distinct
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
90
)
then
a
.
device_id
end
),
0
)
as
dev_num_90
,
nvl
(
sum
(
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
7
)
then
service_price
end
),
0
)
as
gmv_7
,
nvl
(
sum
(
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
30
)
then
service_price
end
),
0
)
as
gmv_30
,
nvl
(
sum
(
case
when
a
.
pay_date
>=
mas
.
partition_date
and
a
.
pay_date
<=
date_add
(
mas
.
partition_date
,
90
)
then
service_price
end
),
0
)
as
gmv_90
FROM
(
SELECT
concat_ws
(
'-'
,
substr
(
partition_date
,
1
,
4
),
substr
(
partition_date
,
5
,
2
),
substr
(
partition_date
,
7
,
2
))
as
partition_date
,
a
.
device_id
,
device_os_type
,
case
when
ios_device
.
idfa
is
not
null
then
ios_device
.
channel
else
a
.
first_channel_source_type
END
as
channel
FROM
(
select
partition_date
,
device_id
,
device_os_type
,
first_channel_source_type
from
online
.
ml_device_day_active_status
where
partition_date
>=
regexp_replace
(
date_sub
(
current_date
(),
30
),
'-'
,
''
)
AND
partition_date
<=
regexp_replace
(
date_sub
(
current_date
(),
1
),
'-'
,
''
)
and
active_type
in
(
'1'
,
'2'
)
)
a
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
=
a
.
device_id
)
mas
left
join
(
SELECT
device_id
,
SUBSTR
(
pay_date
,
1
,
10
)
as
pay_date
,
count
(
distinct
order_id
)
as
order_num
,
sum
(
service_price
)
as
service_price
FROM
online
.
ml_trade_order_detail_day
WHERE
PARTITION_DATE
=
regexp_replace
(
date_sub
(
current_date
(),
1
),
'-'
,
''
)
and
is_pure_user
=
'true'
AND
regexp_replace
(
SUBSTR
(
pay_date
,
1
,
10
),
'-'
,
''
)
>=
regexp_replace
(
date_sub
(
current_date
(),
30
),
'-'
,
''
)
AND
regexp_replace
(
SUBSTR
(
pay_date
,
1
,
10
),
'-'
,
''
)
<=
REGEXP_REPLACE
(
date_sub
(
current_date
(),
1
),
'-'
,
''
)
group
by
device_id
,
SUBSTR
(
pay_date
,
1
,
10
)
)
a
on
mas
.
device_id
=
a
.
device_id
group
by
mas
.
partition_date
,
device_os_type
,
channel
)
t
group
by
partition_date
,
device_os_type
,
channel
\ 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