diff --git a/route_sql/scenario_package.sql b/route_sql/scenario_package.sql index 0d3ceac..c91fd43 100644 --- a/route_sql/scenario_package.sql +++ b/route_sql/scenario_package.sql @@ -70,12 +70,12 @@ GROUP BY order_month ,seq ,SUM(units) FILTER (WHERE order_season = 2019) "2019 qty" - ,SUM(units) FILTER (WHERE order_season = 2020 AND iter = 'copy') "2020 base qty" - ,SUM(units) FILTER (WHERE order_season = 2020 AND iter <> 'copy') "2020 adj qty" + ,SUM(units) FILTER (WHERE order_season = 2020 AND iter IN ('copy','short ship','bad_ship')) "2020 base qty" + ,SUM(units) FILTER (WHERE order_season = 2020 AND iter NOT IN ('copy','short ship','bad_ship')) "2020 adj qty" ,SUM(units) FILTER (WHERE order_season = 2020) "2020 tot qty" ,SUM(value_usd) FILTER (WHERE order_season = 2019) "2019 value_usd" - ,SUM(value_usd) FILTER (WHERE order_season = 2020 AND iter = 'copy') "2020 base value_usd" - ,SUM(value_usd) FILTER (WHERE order_season = 2020 AND iter <> 'copy') "2020 adj value_usd" + ,SUM(value_usd) FILTER (WHERE order_season = 2020 AND iter IN ('copy','short ship','bad_ship')) "2020 base value_usd" + ,SUM(value_usd) FILTER (WHERE order_season = 2020 AND iter NOT IN ('copy','short ship','bad_ship')) "2020 adj value_usd" ,SUM(value_usd) FILTER (WHERE order_season = 2020) "2020 tot value_usd" FROM months