rework basket
This commit is contained in:
parent
b7b3b05e2c
commit
4e062d0625
@ -45,20 +45,27 @@ GROUP BY
|
|||||||
,bill_cust_descr
|
,bill_cust_descr
|
||||||
,ship_cust_descr
|
,ship_cust_descr
|
||||||
)
|
)
|
||||||
, basket AS (
|
, basket1 AS (
|
||||||
SELECT
|
SELECT
|
||||||
part_descr
|
part_descr
|
||||||
,bill_cust_descr
|
,bill_cust_descr
|
||||||
,ship_cust_descr
|
,ship_cust_descr
|
||||||
,SUM(value_usd)/(SELECT SUM(value_usd) FROM baseline) mix
|
,SUM(value_usd) value_usd
|
||||||
FROM
|
FROM
|
||||||
base
|
base
|
||||||
GROUP BY
|
GROUP BY
|
||||||
part_descr
|
part_descr
|
||||||
,bill_cust_descr
|
,bill_cust_descr
|
||||||
,ship_cust_descr
|
,ship_cust_descr
|
||||||
ORDER BY
|
)
|
||||||
mix desc
|
,basket AS (
|
||||||
|
SELECT
|
||||||
|
part_descr
|
||||||
|
,bill_cust_descr
|
||||||
|
,ship_cust_descr
|
||||||
|
,value_usd/sum(value_usd) over () mix
|
||||||
|
FROM
|
||||||
|
basket1
|
||||||
)
|
)
|
||||||
,months AS (
|
,months AS (
|
||||||
SELECT
|
SELECT
|
||||||
|
Loading…
Reference in New Issue
Block a user