Compare commits

..

2 Commits

Author SHA1 Message Date
3e11a3305c convert forecast to budget 2021-06-14 09:57:00 -04:00
5ae24880f2 scale fiber 2021-06-14 09:56:29 -04:00
2 changed files with 114 additions and 3 deletions

111
convert_to_budget.sql Normal file
View File

@ -0,0 +1,111 @@
INSERT INTO
rlarp.osmp_dev
SELECT
"ddord#"
,"dditm#"
,"fgbol#"
,"fgent#"
,"diinv#"
,"dilin#"
,quoten
,quotel
,dcodat
,ddqdat
,dcmdat
,fesdat
,dhidat
,fesind
,dhpost
,fspr
,ddqtoi
,ddqtsi
,fgqshp
,diqtsh
,diext
,ditdis
,discj
,dhincr
,plnt
,promo
,return_reas
,terms
,custpo
,remit_to
,bill_class
,bill_cust
,bill_rep
,bill_terr
,ship_class
,ship_cust
,ship_rep
,ship_terr
,dsm
,account
,shipgrp
,geo
,chan
,chansub
,orig_ctry
,orig_prov
,orig_post
,bill_ctry
,bill_prov
,bill_post
,dest_ctry
,dest_prov
,dest_post
,part
,styc
,colc
,colgrp
,coltier
,colstat
,sizc
,pckg
,kit
,brnd
,majg
,ming
,majs
,mins
,gldco
,gldc
,glec
,harm
,clss
,brand
,assc
,ddunit
,unti
,lbs
,plt
,plcd
,fs_line
,r_currency
,r_rate
,c_currency
,c_rate
,fb_qty
,fb_val_loc
,fb_val_loc_dis
,fb_val_loc_qt
,fb_val_loc_pl
,fb_val_loc_tar
,fb_cst_loc
,fb_cst_loc_cur
,fb_cst_loc_fut
,calc_status
,flag
,odate
,oseas
,rdate
,rseas
,sdate
,sseas
,'b22'
,iter || ' - ' || tag iter
FROM
rlarp.osmfs_dev
WHERE
oseas = 2022
OR sseas = 2022;

View File

@ -3,7 +3,7 @@
WITH WITH
req AS ( req AS (
SELECT SELECT
18454134 value_d 5047782 value_d
) )
---------collapse iterations----------------------- ---------collapse iterations-----------------------
,collapse AS ( ,collapse AS (
@ -58,9 +58,9 @@ req AS (
rlarp.osm_pool o rlarp.osm_pool o
--need to join to itemm to get the product from osm_pool --need to join to itemm to get the product from osm_pool
WHERE WHERE
o.segm <> 'Retail' o.segm = 'Sustainable'
AND substring(o.mins_descr,1,3) = 'A04'
AND o.ship_season = '2022' AND o.ship_season = '2022'
AND o.ship_month = '01 - Jun'
GROUP BY GROUP BY
o.fspr o.fspr
,o.plnt ---master data ,o.plnt ---master data