fiscal period was blank cause rows not to net to -0- with merge, iteration name incorrect for baseline
This commit is contained in:
parent
b4e2ca7919
commit
8de3ee5717
@ -9,7 +9,7 @@ CREATE TEMP TABLE tdr AS (
|
||||
DATERANGE('2020-05-01','2021-05-01','[)') drange
|
||||
,DATERANGE(('2020-05-01'::date + '1 year'::interval)::date,('2021-05-01'::date + '1 year'::interval)::date,'[)') repl
|
||||
,'1 year'::interval AS incr
|
||||
,(SELECT jsonb_agg(x.v) FROM (VALUES('copy'),('actuals'),('actuals plug')) AS x(v)) iter
|
||||
,(SELECT jsonb_agg(x.v) FROM (VALUES('copy'),('actuals'),('actuals_plug')) AS x(v)) iter
|
||||
);
|
||||
|
||||
WITH
|
||||
@ -56,7 +56,8 @@ gld AS (
|
||||
,greatest(least(o.sdate,gld.edat),gld.sdat) dhidat
|
||||
,null::text fesind
|
||||
,null::text dhpost
|
||||
,o.fspr
|
||||
---for forecasting purposes there are no open orders, populate fspr----
|
||||
,ss.fspr
|
||||
-----------measures--------------------
|
||||
,null::numeric ddqtoi
|
||||
,null::numeric ddqtsi
|
||||
@ -169,7 +170,7 @@ gld AS (
|
||||
---exclude integrated quotes----
|
||||
AND version = 'ACTUALS'
|
||||
GROUP BY
|
||||
o.fspr
|
||||
ss.fspr
|
||||
,o.plnt
|
||||
,COALESCE(o.promo,'')
|
||||
,o.terms
|
||||
@ -581,9 +582,7 @@ SELECT * FROM baseline
|
||||
o.odate <@ (SELECT tdr.drange FROM tdr)
|
||||
OR o.odate <@ (SELECT tdr.repl FROM tdr)
|
||||
GROUP BY
|
||||
o.odate
|
||||
,o.rdate
|
||||
,o.dhidat
|
||||
o.dhidat
|
||||
,o.fspr
|
||||
,o.plnt
|
||||
,o.promo
|
||||
|
Loading…
Reference in New Issue
Block a user