Skip to main content

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​

ValueDescription
Replace All (Default)Delete all forecast entries for the forecast name, then insert imported entries.
Replace PeriodFor each forecast combination, delete only entries within the imported date range, then insert. Entries outside the range are preserved.

Aggregate Lines​

ValueDescription
Yes (Default)Aggregate source rows by forecast combination (item, location, variant, date, component forecast, unit of measure). One forecast entry per unique combination.
NoCreate 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​

FieldDescription
Item No.The item number for the forecast entry.
Forecast DateThe date of the forecast entry.
Forecast QuantityThe forecast quantity in the specified unit of measure. Rows with zero quantity are skipped.

Optional​

FieldDescription
Location CodeThe location for the forecast entry.
Variant CodeThe item variant for the forecast entry.
Unit of Measure CodeIf not supplied, the item's base unit of measure is used.
Component ForecastWhether the entry is a component forecast for MRP.
DescriptionStored 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:

FieldReason
Entry No.System-assigned.
Production Forecast NameSet 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 MeasureResolved automatically from the Item Unit of Measure table.

Processing Logic​

  1. 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.
  2. Rows are staged in memory, grouped by the forecast combination key (forecast name, item, location, variant, component forecast, unit of measure).
  3. If Aggregate Lines = Yes, rows sharing the same combination and date are summed.
  4. 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.
  5. Base quantity is always calculated at point of insertion: Forecast Quantity (Base) = Forecast Quantity × Qty. per Unit of Measure.
  6. 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.