From 7f5277546b86d19ccff92973ecf0e91af0a6a7df Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Fri, 15 Mar 2019 12:53:21 -0400 Subject: [PATCH] hardcode notion of baseline iterations into monthly baseline --- route_sql/scenario_package.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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