build sales based mix

This commit is contained in:
Paul Trowbridge 2019-03-19 00:15:43 -04:00
parent d521a30752
commit b7b3b05e2c

View File

@ -50,8 +50,7 @@ GROUP BY
part_descr part_descr
,bill_cust_descr ,bill_cust_descr
,ship_cust_descr ,ship_cust_descr
,SUM(units) units ,SUM(value_usd)/(SELECT SUM(value_usd) FROM baseline) mix
,SUM(value_usd) value_usd
FROM FROM
base base
GROUP BY GROUP BY
@ -59,7 +58,7 @@ GROUP BY
,bill_cust_descr ,bill_cust_descr
,ship_cust_descr ,ship_cust_descr
ORDER BY ORDER BY
value_usd desc mix desc
) )
,months AS ( ,months AS (
SELECT SELECT