make sure days are between 1 and 28
This commit is contained in:
parent
06c545dbc6
commit
7008f57f66
@ -174,7 +174,7 @@ target AS (select target_increment incr)
|
|||||||
_month
|
_month
|
||||||
,seq
|
,seq
|
||||||
,promo
|
,promo
|
||||||
,round((dom_wa/value_usd)::numeric,0)::int odom
|
,greatest(least(round((dom_wa/value_usd)::numeric,0)::int,28),1) odom
|
||||||
,round((rlag_wa/value_usd)::numeric,0)::int rlag
|
,round((rlag_wa/value_usd)::numeric,0)::int rlag
|
||||||
,round((slag_wa/value_usd)::numeric,0)::int slag
|
,round((slag_wa/value_usd)::numeric,0)::int slag
|
||||||
,value_usd/sum(value_usd) over (partition by _month) momix
|
,value_usd/sum(value_usd) over (partition by _month) momix
|
||||||
|
@ -169,7 +169,7 @@ target AS (select target_volume vincr, target_price pincr)
|
|||||||
_month
|
_month
|
||||||
,seq
|
,seq
|
||||||
,promo
|
,promo
|
||||||
,round((dom_wa/value_usd)::numeric,0)::int odom
|
,greatest(least(round((dom_wa/value_usd)::numeric,0)::int,28),1) odom
|
||||||
,round((rlag_wa/value_usd)::numeric,0)::int rlag
|
,round((rlag_wa/value_usd)::numeric,0)::int rlag
|
||||||
,round((slag_wa/value_usd)::numeric,0)::int slag
|
,round((slag_wa/value_usd)::numeric,0)::int slag
|
||||||
,value_usd/sum(value_usd) over (partition by _month) momix
|
,value_usd/sum(value_usd) over (partition by _month) momix
|
||||||
|
@ -247,7 +247,7 @@ target AS (select $$replace_request$$::json def)
|
|||||||
_month
|
_month
|
||||||
,seq
|
,seq
|
||||||
,promo
|
,promo
|
||||||
,round((dom_wa/value_usd)::numeric,0)::int odom
|
,greatest(least(round((dom_wa/value_usd)::numeric,0)::int,28),1) odom
|
||||||
,round((rlag_wa/value_usd)::numeric,0)::int rlag
|
,round((rlag_wa/value_usd)::numeric,0)::int rlag
|
||||||
,round((slag_wa/value_usd)::numeric,0)::int slag
|
,round((slag_wa/value_usd)::numeric,0)::int slag
|
||||||
,value_usd/sum(value_usd) over (partition by _month) momix
|
,value_usd/sum(value_usd) over (partition by _month) momix
|
||||||
|
Loading…
Reference in New Issue
Block a user