From df12babf00a51b266a855ff0ecd3307fc6f841b3 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Mon, 12 Jul 2021 14:31:22 -0400 Subject: [PATCH] update approach and date range --- build/build_rolling.sql | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/build/build_rolling.sql b/build/build_rolling.sql index 71a7d84..27f7e44 100644 --- a/build/build_rolling.sql +++ b/build/build_rolling.sql @@ -1,10 +1,7 @@ /* -baseline - selections from actual, plan, and forecast -incr - increment selection from baseline -incoming - baseline & incr stacked -negative - apply negative values to existing baseline to create a diff -diff - stack incoming and the negative -collapse_diff - group the diff to create single diff rows per item +establish an existing forecast to operate on top of +update to refrect actuals with a diff as an iteration +create and additional to remove pull-forward as actuals flow in */ @@ -21,9 +18,9 @@ CREATE TEMP TABLE tdr AS ( -----------actuals into baseline------------------------------------- DATERANGE('2020-06-01','2021-07-07','[]') arange -----------plan into baseline---------------------------------------- - ,DATERANGE('2021-07-08','2022-06-01','[)') prange + ,DATERANGE('2021-06-01','2022-06-01','[)') prange -----------forecast into baseline------------------------------------ - ,DATERANGE('2022-06-01','2022-06-01','[)') frange + ,DATERANGE('2022-06-01','2022-06-01','[)') frange -- this range effectively excludes -----------baseline selection for increment-------------------------- ,DATERANGE('2021-07-08','2021-07-08','[)') selection -----------selection increment size----------------------------------