From b7b3b05e2c63bcbfcc5df8823f34516e5a06d9c5 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 19 Mar 2019 00:15:43 -0400 Subject: [PATCH] build sales based mix --- route_sql/scenario_package.sql | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/route_sql/scenario_package.sql b/route_sql/scenario_package.sql index fa5414c..e1af6bc 100644 --- a/route_sql/scenario_package.sql +++ b/route_sql/scenario_package.sql @@ -50,8 +50,7 @@ GROUP BY part_descr ,bill_cust_descr ,ship_cust_descr - ,SUM(units) units - ,SUM(value_usd) value_usd + ,SUM(value_usd)/(SELECT SUM(value_usd) FROM baseline) mix FROM base GROUP BY @@ -59,7 +58,7 @@ GROUP BY ,bill_cust_descr ,ship_cust_descr ORDER BY - value_usd desc + mix desc ) ,months AS ( SELECT