From 6b76d9d935e75f3c5d4275b2c3bf7091076ebfdc Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 19 Mar 2025 15:42:11 -0400 Subject: [PATCH] commit: 2025-03-19 15:42:11 --- build/build_forecast.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/build_forecast.sql b/build/build_forecast.sql index bdbbb29..4690e82 100644 --- a/build/build_forecast.sql +++ b/build/build_forecast.sql @@ -3,8 +3,8 @@ /*---------------------------------------------------------------------------------------- 1. copy existing actuals for the current season (which is incomplete) - * for example 6/1/22 -> 3/7/23 -2. fill out a full year of history by going back 2 years to get 3/8/22 -> 5/31/22 + * for example 6/1/24 -> 3/15/25 +2. fill out a full year of history by going back 1 years to get 3/15/24 -> 5/31/24 3. stack the results of 1 & 2 and increment all rows by 1 year */---------------------------------------------------------------------------------------- @@ -122,7 +122,7 @@ baseline AS ( -----when null, greatest/least is just going to act like coalesce ,greatest(least(o.sdate,gld.edat),gld.sdat) sdate ,ss.ssyr sseas - ,'b26' "version" + ,'b26-act' "version" ,'actuals' iter FROM rlarp.osm o @@ -135,7 +135,7 @@ baseline AS ( WHERE ( --base period orders booked.... - o.odate BETWEEN '2024-06-01' AND '2025-03-15' + o.odate BETWEEN '2024-06-01' AND '2025-03-19' --...or any open orders currently booked before cutoff.... --OR (o.calc_status IN ('OPEN','BACKORDER') and o.odate < '2023-03-01') --...or anything that shipped in that period @@ -281,7 +281,7 @@ baseline AS ( -----when null, greatest/least is just going to act like coalesce ,greatest(least(o.sdate,gld.edat),gld.sdat) + interval '1 year' sdate ,ss.ssyr sseas - ,'b26' "version" + ,'b26-act' "version" ,'actuals_plug' iter FROM rlarp.osm o @@ -291,7 +291,7 @@ baseline AS ( greatest(least(o.sdate,gld.edat),gld.sdat) + interval '1 year' BETWEEN ss.sdat AND ss.edat WHERE true - AND o.odate BETWEEN '2024-03-15' AND '2024-05-31' + AND o.odate BETWEEN '2024-03-19' AND '2024-05-31' AND fs_line = '41010' AND calc_status <> 'CANCELED' --AND NOT (calc_status = 'CLOSED' AND flag = 'REMAINDER')