From a8419e9fd6fbdace054368468a77711816983d78 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 4 Nov 2020 22:56:54 -0500 Subject: [PATCH] change target name, and exlude gld joins intended for snapping months, that should be done during data prep --- sql/baseline.sql | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sql/baseline.sql b/sql/baseline.sql index 678771b..339316d 100644 --- a/sql/baseline.sql +++ b/sql/baseline.sql @@ -8,16 +8,10 @@ baseline AS ( ,'actuals' iter FROM rlarp.osm_dev o - --snap the ship dates of the historic fiscal period - LEFT OUTER JOIN gld ON - gld.fspr = o.fspr - --get the shipping season for open orders based on the snapped date - LEFT OUTER JOIN gld ss ON - greatest(least(o.sdate,gld.edat),gld.sdat) BETWEEN ss.sdat AND ss.edat WHERE ( --base period orders booked.... - [target_odate] BETWEEN [target_odate_from] AND [target_odate_to] + [order_field_name] BETWEEN [target_odate_from] AND [target_odate_to] --...or any open orders currently booked before cutoff.... OR ([status_flag] IN ([status_list]) and [target_date] <= [target_date_from]) --...or anything that shipped in that period