Daily Calculations Routines
Overview
The Supply Plan Daily Calculations routine is used to create SKUs, summarize historical records, and calculate planning parameters that could be used for generating a Supply Plan.
How to Run the Routine
Manually:
Navigate to the Administration tab.
Select Supply Plan Daily Calculations from the menu.
Automatically:
It is recommended to schedule this routine to run daily to keep the calculations used for the Supply Plan current.
To schedule the function:
Go to Setup → Apex Class → Schedule Apex.
Enter the Job Name as "SupplyPlanBatchDailyCalculations."
Use "SupplyPlanCalculateSKU" as the Apex Class Name.
Set the schedule with a Weekly frequency and choose to run it every day of the week at 8 PM (or another appropriate time for your organization).
Once SupplyPlanCalculateSKU is finished, two additional apex classes will run automatically:
SupplyPlanCalculateItemUsage
SupplyPlanCalculatePlanning
You can monitor the job status in Apex Jobs.
Results of Running the Routine
The following updates and calculations are performed when running the routine:
1. Create Stockkeeping Units (SKU)
This routine automatically creates SKUs, ensuring that all necessary SKU records are generated. GoldFinch searches for combinations of Warehouse and Item where:
The Item is not blocked.
The Item Type is "Inventory."
The Warehouse where Enable Demand Forecasting is checked.
For any Item-Warehouse combination not already defined in GoldFinch, new SKU records will be created by copying the planning parameters from the item.
2. Update Item Usage
Item Usage entries track inventory transaction quantities based on the defined Inventory Period Type. These entries are used for forecasting and reporting. The routine creates Item Usage entries for any newly created Item Ledger Entries in warehouses where Enable Demand Planning is checked.
For more information on maintaining Item Usage entries, refer to the Item Usage page.
3. Update First Stock Date
If the First Stock Date field on an SKU is blank, the routine updates it with the posting date of the first Item Ledger Entry of a positive quantity.
4. Insert Previous Period Item Usage
Previous Period Item Usage records store the Best Fit Model for the SKU, which is required to calculate forecasts.
5. Find the Best Fit Model
The routine calculates the Best Fit Model for each SKU and stores this information in the Calculated Best Fit Model field. To calculate the best fit, the routine loops through each active forecast model to calculate the Forecast Quantity for different periods.
For example, if the setup is as follows:
Forecast Accuracy Calculation Method: MAPE
Inventory Period Type: By Month
Periods to Forecast: 12
Periods to Re-Forecast: 4
GoldFinch calculates forecast quantities using various forecast models and selects the model with the lowest MAPE (Mean Absolute Percentage Error). The process involves re-forecasting historical data and comparing it to actual quantities to determine the most accurate model for each SKU.
Example
Today's date: 3/25/20
Current Inventory Period Date: 3/1/20
Re-Forecast Periods: The routine retrieves prior Item Usage records starting from 2/1/20 and re-forecasts 4 periods back:
2/1/20
1/1/20
12/1/19
11/1/19
Active Forecast Models
Assume there are three active forecast models:
3-Month Moving Average
Seasonal Index
6-Month Moving Average
For each of the re-forecast periods, GoldFinch calculates forecast quantities for each model, and then compares the Forecast Quantity to the Actual Quantity for each period.
Re-Forecast Calculations Table
Starting Date | Forecast Model | Actual | Forecast | Qty. Difference | % Difference |
---|---|---|---|---|---|
2/1/20 | 3-Month Moving Average | 100 | 95 | 5 | 5% |
1/1/20 | 3-Month Moving Average | 90 | 80 | 10 | 11% |
12/1/19 | 3-Month Moving Average | 110 | 101 | 9 | 8% |
11/1/19 | 3-Month Moving Average | 85 | 97 | 12 | 14% |
2/1/20 | Seasonal Index | 100 | 110 | 10 | 10% |
1/1/20 | Seasonal Index | 90 | 91 | 1 | 1% |
12/1/19 | Seasonal Index | 110 | 109 | 1 | 1% |
11/1/19 | Seasonal Index | 85 | 87 | 2 | 2% |
2/1/20 | 6-Month Moving Average | 100 | 95 | 5 | 5% |
1/1/20 | 6-Month Moving Average | 90 | 50 | 40 | 44% |
12/1/19 | 6-Month Moving Average | 110 | 60 | 50 | 45% |
11/1/19 | 6-Month Moving Average | 85 | 70 | 15 | 18% |
Selecting the Best Fit Forecast Model
Using the MAPE method, GoldFinch calculates the average percentage error for each model:
Forecast Model | MAPE |
---|---|
3-Month Moving Average | 10% |
Seasonal Index | 4% |
6-Month Moving Average | 28% |
In this case, the Seasonal Index is selected as the Best Fit Forecast Model for the SKU because it has the lowest MAPE. Note that different SKUs may have different Best Fit Models.
The selected Best Fit Forecast Model is stored in the Calculated Best Fit Model field within prior period item usage records.
For more details on forecast models and how they are calculated, see Configure Forecast Models .
6. Overwrite the Best Fit Forecast Model
You can manually lock a forecast model for a SKU by entering an active forecast model in the Locked Forecast Model field. If left blank, GoldFinch will use the Calculated Best Fit Forecast Model. If needed, you can also define a Locked Forecast Model in the Demand Planning Setup to apply it to all SKUs that do not have a model specified.
7. Update Planning Parameters
The following planning parameters will be calculated per SKU:
Calculated Daily Usage:
Calculated Daily Usage = Total Sales Qty. / No. of Days.
Total Sales Qty. is calculated based on the Inventory Period Type:
By Month: Uses the past 12 months of sales history.
By Week: Uses the past 13 weeks of sales history.
Calculated Reorder Quantity:
Calculated Reorder Qty. = (total future Forecast Qty. * 2 * Ordering Cost) / (Carrying Cost per Unit * Unit Cost)
Future Forecast Qty. is calculated based on the Inventory Period Type:
By Month: Uses the future 12 months of sales history.
By Week: Uses the future 13 weeks of sales history.
Unit Cost: Taken from the Last Invoiced Base Cost on the item card. If unavailable, the Standard Base Cost is used.
Ordering Cost: Defined at the warehouse level, per purchase order.
Carrying Cost per Unit defined on the Warehouse is used based on the Inventory Period Type:
By Month: % per unit per year.
By Week: % per unit per quarter.
Calculated Lead Time:
Calculated Lead Time = (Actual Receipt Date on WR - Order Date on PO) / No. of Receipts
Inventory Receipts will be used based on the Inventory Period Type:
By Month: Uses the past 12 months of receipt history.
By Week: Uses the past 13 weeks of receipt history.
Calculated Safety Stock:
Calculated Safety Stock = Calculated Lead Time * Calculated Daily Usage