From 2253d650476bc9daac2c3cfaebc93f258e766e65 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Tue, 3 Aug 2021 08:26:05 -0400 Subject: [PATCH] group by percentage of row to keep, and filter out -0- --- build/build_pullforward.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/build_pullforward.sql b/build/build_pullforward.sql index f606255..837dcd8 100644 --- a/build/build_pullforward.sql +++ b/build/build_pullforward.sql @@ -200,6 +200,7 @@ tdr AS ( CROSS JOIN log WHERE e.flag + AND e.plan_units <> 0 GROUP BY o.fspr ,o.plnt @@ -230,6 +231,7 @@ tdr AS ( ,o.r_rate ,o.c_currency ,o.c_rate + ,(-e.qty/e.plan_units) --removal_rate ,o.calc_status ,o.flag ,o.order_date