Fix product performance grouped JSON build
This commit is contained in:
@@ -962,11 +962,37 @@ func productPerformanceExcelProductScore(suffix string, salesUSD, stockTurnover,
|
||||
score := 0.30*productPerformanceExcelMarginScore(margin) +
|
||||
0.20*productPerformanceExcelRatioScore(stockTurnover, 4) +
|
||||
0.20*revenueScore +
|
||||
0.15*productPerformanceExcelRatioScore(marketCount, 8) +
|
||||
0.15*productPerformanceExcelRatioScore(customerCount, 25)
|
||||
0.15*productPerformanceExcelRatioScore(marketCount, productPerformanceExcelMarketSpreadTarget(suffix)) +
|
||||
0.15*productPerformanceExcelRatioScore(customerCount, productPerformanceExcelCustomerSpreadTarget(suffix))
|
||||
return productPerformanceExcelRoundScore(score)
|
||||
}
|
||||
|
||||
func productPerformanceExcelMarketSpreadTarget(suffix string) float64 {
|
||||
switch suffix {
|
||||
case "90d":
|
||||
return 3
|
||||
case "180d":
|
||||
return 5
|
||||
case "365d":
|
||||
return 6
|
||||
default:
|
||||
return 8
|
||||
}
|
||||
}
|
||||
|
||||
func productPerformanceExcelCustomerSpreadTarget(suffix string) float64 {
|
||||
switch suffix {
|
||||
case "90d":
|
||||
return 8
|
||||
case "180d":
|
||||
return 15
|
||||
case "365d":
|
||||
return 18
|
||||
default:
|
||||
return 25
|
||||
}
|
||||
}
|
||||
|
||||
func productPerformanceExcelProductRevenueTarget(suffix string) float64 {
|
||||
switch suffix {
|
||||
case "180d":
|
||||
|
||||
Reference in New Issue
Block a user