Calculate Forecasts
In GoldFinch, Sales Forecasts can be manually entered, imported, or calculated based on historical sales.
Before running the Calculate Forecast function, you will want to:
Ensure that the Supply Plan Daily Calculation Routine has been run manually or via the scheduled nightly job. This will update the SKUs, Item Usage records for historical actual sales quantities, and find the best fit model for each SKU in the prior period.
Enter any Item Usage Adjustments to account for abnormal sales activities or exclusions.
Run the Calculate Forecast Function
Setup Demand Planning Setup
Navigate to Demand Planning Setup. Review Periods to Forecast and Inventory Period Type.
![](../__attachments/1293451748/image-20220920-143138.png?inst-v=7859a023-5511-40be-b967-a1e2fed73946)
Run Calculate Forecast
Once the above steps have been completed, click the Calculate Forecast button from the Sales Forecast list.
![](../__attachments/1293451748/image-20220920-142955.png?inst-v=7859a023-5511-40be-b967-a1e2fed73946)
This function will delete the existing Sales Forecasts and then use the Best Fit Forecast Model for each SKU to calculate the forecast quantities for each of the SKUs by the warehouse.
Schedule Calculate Forecast
You can also schedule Calculate Forecast routine.
To schedule the function, go to Setup → Apex Class → Schedule Apex.
The Job name should be Calculate Forecast.
The Apex Class name should be SalesForecastBatchDelete.
Set the Schedule with a Weekly frequency and select for it to occur every day of the week at 12 PM (or another time that is later than the finished time of the scheduled SupplyPlanBatchDailyCalculations routine)
![](../__attachments/1293451748/image-20220920-143730.png?inst-v=7859a023-5511-40be-b967-a1e2fed73946)
When SalesForecastBatchDelete is finished, the apex class SalesForecastBatchCalculate will run. You can go to Apex Jobs to monitor the status.
SalesForecastBatchCalculate job is a very CPU intensive job. If you get Apex CPU time limit exceeded error in the Apex Jobs, you can go to Setup\Custom Settings\System Settings to change the SalesForecastBatchCalculateBatchSize parameter to a lower number, such as 25. By default, systems uses 50 as the batch size. Add this parameter if it is not in the System Settings yet.
Calculate Forecast Example with Sample Calculations
To illustrate how GoldFinch calculates forecasts, let us assume the following setups in the Update Demand Planning Setup for today's date of 3/25/20.
Field Label | Demo Value |
---|---|
Inventory Period Type | By Month |
Periods to Forecast | 12 |
GoldFinch will create forecasts from 3/1/20 (the current period's Starting Date) through 2/1/21.
Here are the steps the routine will perform to gather and calculate the forecast figures:
GoldFinch will retrieve all of the Item Usage records with the Starting Date of 2/1/20 (the prior period). These records have the Best Fit Forecast Model defined for each of the SKUs as a result of the Supply Plan Daily Calculation routine.
For each of the prior periods' Item Usage records, GoldFinch will forecast the future 12 months using the Best Fit Forecast Model.
GoldFinch will forecast the future 12 months differently depending on how you have the Calculate First Period Forecast Only option selected on the Forecast Model.
For example, if you want to use the average of the last 12 months to forecast the future 12 months, you would configure a forecast model with the Calculate First Period Forecast Only field checked, and with the following forecast model lines.
Period | Adjustment | Weight | Included in Trend | Seasonal Trend |
---|---|---|---|---|
1 | 0 | 1 | No | No |
2 | 0 | 1 | No | No |
3 | 0 | 1 | No | No |
4 | 0 | 1 | No | No |
5 | 0 | 1 | No | No |
6 | 0 | 1 | No | No |
7 | 0 | 1 | No | No |
8 | 0 | 1 | No | No |
9 | 0 | 1 | No | No |
10 | 0 | 1 | No | No |
11 | 0 | 1 | No | No |
12 | 0 | 1 | No | No |
GoldFinch will calculate the forecast for 3/1/20 using the average Actual Qty. from 3/1/19 to 2/1/20, then copy the forecast to periods from 4/1/20 to 2/1/21.
If you did not check the Calculate First Period Forecast Only on Forecast Model, GoldFinch will calculate the forecast for 4/1/20 using the actual quantity from 4/1/19 to 2/1/20, and the forecast for 3/1/20 as the actual. This will continue to happen for periods from 5/1/20 to 2/1/21. The forecast quantity will most likely not be the same for the periods from 3/1/20 to 2/1/21.