increment snapshot period
This commit is contained in:
parent
c48e52f95c
commit
b2147b0a02
@ -21,7 +21,7 @@ tdr AS (
|
||||
DATERANGE('2021-06-01','2022-06-01','[)') prange
|
||||
-----------explicitly call out overlap period------------------------
|
||||
-----------anythign in this period has to net out to match actuals---
|
||||
,DATERANGE('2021-06-01','2021-07-12','[]') overlap
|
||||
,DATERANGE('2021-06-01','2021-07-29','[]') overlap
|
||||
,jsonb_build_array('plan','diff') iter
|
||||
)
|
||||
,booked AS materialized(
|
||||
|
@ -16,19 +16,19 @@ DROP TABLE IF EXISTS tdr;
|
||||
CREATE TEMP TABLE tdr AS (
|
||||
SELECT
|
||||
-----------actuals into baseline-------------------------------------
|
||||
DATERANGE('2020-06-01','2021-07-15','[]') arange
|
||||
DATERANGE('2020-06-01','2021-07-29','[]') arange
|
||||
-----------plan into baseline----------------------------------------
|
||||
,DATERANGE('2020-06-01','2022-06-01','[)') prange
|
||||
-----------forecast into baseline------------------------------------
|
||||
,DATERANGE('2022-06-01','2022-06-01','[)') frange -- this range effectively excludes
|
||||
-----------baseline selection for increment--------------------------
|
||||
,DATERANGE('2021-07-15','2021-07-15','[)') selection
|
||||
,DATERANGE('2021-07-29','2021-07-29','[)') selection
|
||||
-----------selection increment size----------------------------------
|
||||
,'0 year'::interval AS incr
|
||||
-----------iterations to merge with----------------------------------
|
||||
,(SELECT jsonb_agg(x.v) FROM (VALUES('copy'),('actuals'),('actuals_plug')) AS x(v)) iter
|
||||
-----------existing baseline overlap---------------------------------
|
||||
,DATERANGE('2000-06-01','2021-07-08') overlap
|
||||
,DATERANGE('2000-06-01','2021-07-29') overlap
|
||||
);
|
||||
|
||||
--select * from tdr
|
||||
|
Loading…
Reference in New Issue
Block a user