From ae9bba67bd862a6af80f3aeb4c6254c7fb419173 Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Wed, 12 Feb 2020 17:13:00 -0500 Subject: [PATCH] fix casts --- route_sql/build/build_forecast.sql | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/route_sql/build/build_forecast.sql b/route_sql/build/build_forecast.sql index 26490d5..b4f0a4c 100644 --- a/route_sql/build/build_forecast.sql +++ b/route_sql/build/build_forecast.sql @@ -1,5 +1,5 @@ --\timing -truncate table rlarp.osmfs; +truncate table rlarp.osmf_dev; WITH gld AS ( @@ -106,14 +106,14 @@ gld AS ( ,null::text assc ,null::text ddunit ,null::text unti - ,null::text lbs - ,null::text plt + ,null::numeric lbs + ,null::numeric plt ,null::text plcd ,o.fs_line ,o.r_currency - ,null::text r_rate + ,null::numeric r_rate ,o.c_currency - ,null::text c_rate + ,null::numeric c_rate ,sum(o.fb_qty) fb_qty ,sum(o.fb_val_loc) fb_val_loc ,sum(o.fb_val_loc_dis) fb_val_loc_dis @@ -250,14 +250,14 @@ gld AS ( ,null::text assc ,null::text ddunit ,null::text unti - ,null::text lbs - ,null::text plt + ,null::numeric lbs + ,null::numeric plt ,null::text plcd ,o.fs_line ,o.r_currency - ,null::text r_rate + ,null::numeric r_rate ,o.c_currency - ,null::text c_rate + ,null::numeric c_rate ,sum(o.fb_qty) fb_qty ,sum(o.fb_val_loc) fb_val_loc ,sum(o.fb_val_loc_dis) fb_val_loc_dis @@ -390,14 +390,14 @@ gld AS ( ,null::text assc ,null::text ddunit ,null::text unti - ,null::text lbs - ,null::text plt + ,null::numeric lbs + ,null::numeric plt ,null::text plcd ,o.fs_line ,o.r_currency - ,null::text r_rate + ,null::numeric r_rate ,o.c_currency - ,null::text c_rate + ,null::numeric c_rate ,sum(o.fb_qty) fb_qty ,sum(o.fb_val_loc) fb_val_loc ,sum(o.fb_val_loc_dis) fb_val_loc_dis @@ -564,7 +564,7 @@ UNION ALL SELECT * FROM baseline; ---identify short ships: causes disconnect with actual sales------------------------------------------------------------------- -UPDATE rlarp.osmfs SET iter = 'short ship' WHERE calc_status = 'CLOSED' AND flag = 'REMAINDER'; +--UPDATE rlarp.osmfs SET iter = 'short ship' WHERE calc_status = 'CLOSED' AND flag = 'REMAINDER'; ---identify goofy ship dates: causes disconnect with sales when splicing in a forecast that has this problem------------------- -UPDATE rlarp.osmfs SET iter = 'bad date' WHERE adj_shipdate < adj_orderdate; \ No newline at end of file +--UPDATE rlarp.osmfs SET iter = 'bad date' WHERE adj_shipdate < adj_orderdate; \ No newline at end of file