Updates to the newest season in scenario_package.sql

This commit is contained in:
PhilRunninger 2023-02-27 16:15:35 -05:00
parent 21e72a42cc
commit 5b507d3d65

View File

@ -36,7 +36,7 @@ FROM
rlarp.osm_pool
WHERE
where_clause
AND order_season IN (2021,2022)
AND order_season IN (2022,2023)
GROUP BY
order_season
,order_month
@ -94,14 +94,14 @@ GROUP BY
SELECT
order_month
,seq
,SUM(units) FILTER (WHERE order_season = 2021) "2021 qty"
,SUM(units) FILTER (WHERE order_season = 2022 AND iter IN ('copy','short ship','bad_ship','plan')) "2022 base qty"
,SUM(units) FILTER (WHERE order_season = 2022 AND iter NOT IN ('copy','short ship','bad_ship','plan')) "2022 adj qty"
,SUM(units) FILTER (WHERE order_season = 2022) "2022 tot qty"
,SUM(value_usd) FILTER (WHERE order_season = 2021) "2021 value_usd"
,SUM(value_usd) FILTER (WHERE order_season = 2022 AND iter IN ('copy','short ship','bad_ship','plan')) "2022 base value_usd"
,SUM(value_usd) FILTER (WHERE order_season = 2022 AND iter NOT IN ('copy','short ship','bad_ship','plan')) "2022 adj value_usd"
,SUM(value_usd) FILTER (WHERE order_season = 2022) "2022 tot value_usd"
,SUM(units) FILTER (WHERE order_season = 2022) "2022 qty"
,SUM(units) FILTER (WHERE order_season = 2023 AND iter IN ('copy','short ship','bad_ship','plan')) "2023 base qty"
,SUM(units) FILTER (WHERE order_season = 2023 AND iter NOT IN ('copy','short ship','bad_ship','plan')) "2023 adj qty"
,SUM(units) FILTER (WHERE order_season = 2023) "2023 tot qty"
,SUM(value_usd) FILTER (WHERE order_season = 2022) "2022 value_usd"
,SUM(value_usd) FILTER (WHERE order_season = 2023 AND iter IN ('copy','short ship','bad_ship','plan')) "2023 base value_usd"
,SUM(value_usd) FILTER (WHERE order_season = 2023 AND iter NOT IN ('copy','short ship','bad_ship','plan')) "2023 adj value_usd"
,SUM(value_usd) FILTER (WHERE order_season = 2023) "2023 tot value_usd"
FROM
months
GROUP BY
@ -113,14 +113,14 @@ GROUP BY
,mlist AS (
SELECT
mseq.m order_month
,"2021 qty"
,"2022 base qty"
,"2022 adj qty"
,"2022 tot qty"
,"2021 value_usd"
,"2022 base value_usd"
,"2022 adj value_usd"
,"2022 tot value_usd"
,"2022 qty"
,"2023 base qty"
,"2023 adj qty"
,"2023 tot qty"
,"2022 value_usd"
,"2023 base value_usd"
,"2023 adj value_usd"
,"2023 tot value_usd"
FROM
mseq
LEFT OUTER JOIN mpvt ON