Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
Amazon-Selection-Data
Overview
Overview
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
abel_cjy
Amazon-Selection-Data
Commits
11dc41a5
Commit
11dc41a5
authored
Jan 07, 2026
by
chenyuanjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ABA搜索词-bsr相关指标采用Amazon销量代替计算
parent
9d0dad52
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
dwt_aba_st_analytics.py
Pyspark_job/dwt/dwt_aba_st_analytics.py
+8
-11
No files found.
Pyspark_job/dwt/dwt_aba_st_analytics.py
View file @
11dc41a5
...
...
@@ -511,7 +511,7 @@ class DwtAbaStAnalytics(Templates):
)
.
withColumn
(
# 新品bsr销量
"asin_is_new_bsr_orders"
,
F
.
when
(
F
.
col
(
"asin_is_new"
)
==
1
,
F
.
col
(
"asin_
bsr
_orders"
))
F
.
when
(
F
.
col
(
"asin_is_new"
)
==
1
,
F
.
col
(
"asin_
amazon
_orders"
))
)
.
withColumn
(
# 新品zr销量
"asin_is_new_zr_orders"
,
...
...
@@ -564,7 +564,7 @@ class DwtAbaStAnalytics(Templates):
self
.
df_st_brand_cal
=
self
.
df_st_brand_cal
.
filter
(
"asin_brand_name is not null"
)
self
.
df_st_brand_cal
=
self
.
df_st_brand_cal
.
filter
(
"asin_brand_name not in('null','None')"
)
self
.
df_st_brand_cal
=
self
.
df_st_brand_cal
.
groupby
([
'search_term'
,
'asin_brand_name'
])
.
agg
(
F
.
sum
(
"asin_
bsr
_orders"
)
.
alias
(
"asin_brand_bsr_orders_total"
),
F
.
sum
(
"asin_
amazon
_orders"
)
.
alias
(
"asin_brand_bsr_orders_total"
),
F
.
sum
(
"asin_zr_orders"
)
.
alias
(
"asin_brand_zr_orders_total"
)
)
...
...
@@ -614,7 +614,7 @@ class DwtAbaStAnalytics(Templates):
# 计算卖家top3销量和总销量
self
.
df_st_seller_cal
=
self
.
df_st_seller_cal
.
filter
(
"account_id is not null"
)
self
.
df_st_seller_cal
=
self
.
df_st_seller_cal
.
groupby
([
'search_term'
,
'account_id'
])
.
agg
(
F
.
sum
(
"asin_
bsr
_orders"
)
.
alias
(
"asin_seller_bsr_orders_total"
),
F
.
sum
(
"asin_
amazon
_orders"
)
.
alias
(
"asin_seller_bsr_orders_total"
),
F
.
sum
(
"asin_zr_orders"
)
.
alias
(
"asin_seller_zr_orders_total"
)
)
...
...
@@ -723,25 +723,21 @@ class DwtAbaStAnalytics(Templates):
"asin_count"
,
"total_asin_num"
)
.
withColumnRenamed
(
# 总bsr销量
"st_bsr_orders"
,
"bsr_orders"
)
.
withColumnRenamed
(
# 总预估销量
"st_zr_orders"
,
"orders"
)
.
withColumn
(
# 销量占比 新品销量占比
"new_bsr_orders_proportion"
,
F
.
round
(
F
.
col
(
"new_asin_bsr_orders"
)
/
F
.
col
(
"
bsr_order
s"
),
3
)
F
.
round
(
F
.
col
(
"new_asin_bsr_orders"
)
/
F
.
col
(
"
amazon_monthly_sale
s"
),
3
)
)
.
withColumn
(
# 品牌垄断系数
"brand_monopoly"
,
F
.
ceil
((
F
.
col
(
"top3_brand_bsr_orders"
)
/
F
.
col
(
"
bsr_order
s"
))
*
1000
)
/
1000
F
.
ceil
((
F
.
col
(
"top3_brand_bsr_orders"
)
/
F
.
col
(
"
amazon_monthly_sale
s"
))
*
1000
)
/
1000
)
.
withColumn
(
# 卖家垄断系数
"seller_monopoly"
,
F
.
ceil
((
F
.
col
(
"top3_seller_bsr_orders"
)
/
F
.
col
(
"
bsr_order
s"
))
*
1000
)
/
1000
F
.
ceil
((
F
.
col
(
"top3_seller_bsr_orders"
)
/
F
.
col
(
"
amazon_monthly_sale
s"
))
*
1000
)
/
1000
)
.
withColumn
(
# ABA搜索词拆分的单词个数
"st_word_num"
,
...
...
@@ -810,7 +806,7 @@ class DwtAbaStAnalytics(Templates):
"rank"
,
"category_id"
,
"orders"
,
"bsr_orders"
,
F
.
col
(
"amazon_monthly_sales"
)
.
alias
(
"bsr_orders"
)
,
"search_volume"
,
"quantity_being_sold"
,
F
.
round
(
"st_ao_avg"
,
3
)
.
alias
(
"st_ao_avg"
),
...
...
@@ -924,6 +920,7 @@ class DwtAbaStAnalytics(Templates):
"is_new_market_segment"
:
0
,
"is_high_return_text"
:
0
,
"amazon_monthly_sales"
:
0
,
"bsr_orders"
:
0
,
"is_hidden_cate"
:
0
})
...
...
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