commit: 2025-03-19 15:42:11
This commit is contained in:
parent
2941e0f3a4
commit
6b76d9d935
@ -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')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user