Demand Forecast Import
Business Value
Maintaining demand forecasts manually through the matrix page in Business Central is workable for small item ranges, but becomes impractical when forecasts cover hundreds or thousands of item/location/variant combinations. External planning tools, spreadsheets, and statistical forecasting systems often produce forecast data that needs to be loaded in bulk.
Possible Scenarios
- Loading a monthly demand forecast generated by an external planning system.
- Importing seasonal forecasts across multiple locations from a shared spreadsheet.
- Replacing existing forecasts with updated projections from a statistical model.
- Bulk-loading component forecasts for MRP planning.
Feature Details
The Import action is available on the Demand Forecast Card (page 2901) in Business Central. The import reads forecast data into a temporary staging table, then writes to Production Forecast Entry according to the selected update method.
The forecast name is set automatically from the Demand Forecast Card you import from (or from import definition record defaults when using import definitions).
The import supports two update methods:
- Replace All — deletes all existing forecast entries for the forecast name, then inserts the imported data.
- Replace Period — for each forecast combination in the file, replaces entries only within the date range present in the file. Entries outside that range are untouched.
Supported File Formats
- Excel files (.xlsx, .xls)
- CSV/Text files (.csv, .txt)
Prerequisites
- The Demand Forecast Name must exist before importing.
- Items referenced in the file must exist in Business Central.
- Location and Variant codes (if supplied) must be valid.
Settings
Update Method
| Value | Description |
|---|---|
| Replace All (Default) | Delete all forecast entries for the forecast name, then insert imported entries. |
| Replace Period | For each forecast combination, delete only entries within the imported date range, then insert. Entries outside the range are preserved. |
Aggregate Lines
| Value | Description |
|---|---|
| Yes (Default) | Aggregate source rows by forecast combination (item, location, variant, date, component forecast, unit of measure). One forecast entry per unique combination. |
| No | Create a separate forecast entry for each source row. |
When using Replace Period with Aggregate Lines = Yes, the import compares aggregated totals against existing entries and only rewrites combinations where values have changed.
Source File Fields
Mandatory
| Field | Description |
|---|---|
| Item No. | The item number for the forecast entry. |
| Forecast Date | The date of the forecast entry. |
| Forecast Quantity | The forecast quantity in the specified unit of measure. Rows with zero quantity are skipped. |
Optional
| Field | Description |
|---|---|
| Location Code | The location for the forecast entry. |
| Variant Code | The item variant for the forecast entry. |
| Unit of Measure Code | If not supplied, the item's base unit of measure is used. |
| Component Forecast | Whether the entry is a component forecast for MRP. |
| Description | Stored on the forecast entry (most useful with Aggregate Lines = No). |
Fields That Cannot Be Mapped
The following fields are protected and excluded from the field selection list:
| Field | Reason |
|---|---|
| Entry No. | System-assigned. |
| Production Forecast Name | Set from context (Demand Forecast Card or import definition record defaults). |
| Forecast Quantity (Base) | Calculated automatically from Forecast Quantity × Qty. per Unit of Measure. |
| Qty. per Unit of Measure | Resolved automatically from the Item Unit of Measure table. |
Processing Logic
- Each row is read from the file and defaults are applied:
- Forecast Name is set from the Demand Forecast Card context.
- Unit of Measure defaults to the item's base UOM if not specified.
- Qty. per Unit of Measure is resolved from the Item Unit of Measure table.
- Rows are staged in memory, grouped by the forecast combination key (forecast name, item, location, variant, component forecast, unit of measure).
- If Aggregate Lines = Yes, rows sharing the same combination and date are summed.
- On apply:
- Replace All: All existing entries for the forecast name are deleted, then non-zero staged rows are inserted with calculated base quantities.
- Replace Period: Each combination's date range is calculated from the imported data. Existing entries within that range are replaced; entries outside are preserved. When aggregating, unchanged values are skipped.
- Base quantity is always calculated at point of insertion:
Forecast Quantity (Base) = Forecast Quantity × Qty. per Unit of Measure. - Standard table insert triggers fire, including Planning Assignment updates.
Quantity Rules
- Positive and negative quantities are permitted.
- Zero quantities do not create forecast entries.
- In a replacement operation, a zero quantity for a combination/date means no entry remains for that slot.