forecast_api/route_sql
PhilRunninger 47d1baffc5 Handle the case where baseline is zero (units or value).
This happens when a customer places identical orders and specifies that
they be shipped in different seasons. We end up with one order shipped
in 2023 and one open for 2024. Under our current operating procedures,
open orders are subtracted from shipped orders and are presented as
baseline for the next forecast. The zero that appears in the baseline in
this case was causing all kinds of issues in the SQL scripts for
inserting the adjustments, ranging from finding zero rows to adjust to
division by zero.

Another change required to correct this was updating the iter value of
the open orders from 'actuals' to 'copy':

    UPDATE rlarp.osm_pool
    SET iter = 'copy'
    WHERE tag = 'open-orders'
2023-05-17 05:28:21 -04:00
..
addmonth_vupd.sql Handle the case where baseline is zero (units or value). 2023-05-17 05:28:21 -04:00
adj_totals.sql Update some 2022 references to 2024, and fix round() function calls. 2023-04-05 12:37:35 -04:00
get_pool.sql Add options to query by director or segment. Also speed it up A LOT. 2023-05-09 01:24:08 -04:00
list_changes.sql sort result sets by id 2021-06-02 15:50:21 +00:00
new_basket.sql Handle the case where baseline is zero (units or value). 2023-05-17 05:28:21 -04:00
scale_pd.sql Handle the case where baseline is zero (units or value). 2023-05-17 05:28:21 -04:00
scale_vd.sql Handle the case where baseline is zero (units or value). 2023-05-17 05:28:21 -04:00
scale_vupd_sales.sql Update some 2022 references to 2024, and fix round() function calls. 2023-04-05 12:37:35 -04:00
scale_vupd.sql Handle the case where baseline is zero (units or value). 2023-05-17 05:28:21 -04:00
scenario_package.sql Get pounds to update for each forecast adjustment. 2023-04-27 16:54:37 -04:00
swap_cust.sql populate dsm when swapping customers, rework pool quate rep snap 2021-04-16 13:57:32 -04:00
swap_fit.sql Switch source table from rlarp.itemmv to "CMS.CUSLG".itemm 2023-03-01 17:55:30 -05:00
swap_post.sql Switch source table from rlarp.itemmv to "CMS.CUSLG".itemm 2023-03-01 17:55:30 -05:00
undo.sql Prevent accidental undo of initial baseline load. 2023-05-03 15:34:17 -04:00