D365 Reference
ForecastSales
worksheet lineDemand (sales) forecast lines — one row per forecast model, item, dimension set, and period start, carrying forecast quantity, price, and amount; the demand input the master plan consumes
Module: Master PlanningCompany-partitioned (DataAreaId)
Fields
15 fields · 2 key
| Key | Field | EDT | Description | Type | Length | Flags |
|---|---|---|---|---|---|---|
| Key | ModelId | Forecast model the line belongs to — filter to the active model before aggregating, or overlapping scenarios double-count | string | |||
| Key | ItemId | ItemId | Item the forecast is for | string | 20 | |
| StartDate | Start of the forecast period — the date the plan consumes the quantity on; the primary analysis date | date | ||||
| EndDate | Optional end of the forecast period; unset rows carry the 1900-01-01 sentinel | date | ||||
| SalesQty | Forecast quantity in the sales unit | real | ||||
| SalesPrice | Forecast unit price | real | ||||
| Amount | Forecast amount for the line in the line currency | real | ||||
| Currency | Currency of the forecast amount | string | ||||
| InventDimId | InventDimId | Inventory-dimension combination the forecast is placed at (typically site/warehouse); join to InventDim to resolve | string | 25 | ||
| CustAccountId | CustAccount | Customer the forecast is placed against, when forecasting by customer | string | 20 | ||
| CustGroupId | Customer group the forecast is placed against, when forecasting by group | string | 10 | |||
| ItemGroupId | Item group of the forecast line | string | 10 | |||
| SalesUnitId | Sales unit the forecast quantity is expressed in | string | ||||
| Active | Whether the forecast line is active and included in planning | enum | ||||
| DefaultDimension | RecId | RecId of the line's financial-dimension value set in DimensionAttributeValueSet | int64 |
Field provenance: hand-curated.
Boilerplate SQL
Starting point for reading ForecastSaleson Databricks — enums are decoded, 1900-01-01 dates are wrapped to NULL, and the DataAreaId anchor is in place. Set your Unity Catalog location, company, and filter values below; they’re substituted into the SQL and the copy button.
Query parameters
-- ============================================================
-- Table : ForecastSales Demand (sales) forecast lines — one row per forecast model, item, dimension set, and period start, carrying forecast quantity, price, and amount; the demand input the master plan consumes
-- Purpose: Column-selected read of ForecastSales — auto-generated from field metadata
-- Grain : One row per company (dataareaid) + ModelId + ItemId
-- Notes : Auto-generated skeleton for Synapse Link / Fabric Link-landed F&O data (lowercase column names). Enums decoded inline where verified; datetimes stored in UTC; 1900-01-01 dates are sentinels mapped to NULL. System/audit columns omitted — see the quirks guide.
-- ============================================================
SELECT
f.modelid AS "Forecast model the line belongs to — filter to the active model before aggregating, or overlapping scenarios double-count",
f.itemid AS "Item the forecast is for",
f.startdate AS "Start of the forecast period — the date the plan consumes the quantity on; the primary analysis date",
CASE WHEN CAST(f.enddate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(f.enddate AS DATE) END AS "Optional end of the forecast period; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
f.salesqty AS "Forecast quantity in the sales unit",
f.salesprice AS "Forecast unit price",
f.amount AS "Forecast amount for the line in the line currency",
f.currency AS "Currency of the forecast amount",
f.inventdimid AS "Inventory-dimension combination the forecast is placed at (typically site/warehouse); join to InventDim to resolve",
f.custaccountid AS "Customer the forecast is placed against, when forecasting by customer",
f.custgroupid AS "Customer group the forecast is placed against, when forecasting by group",
f.itemgroupid AS "Item group of the forecast line",
f.salesunitid AS "Sales unit the forecast quantity is expressed in",
f.active AS "Whether the forecast line is active and included in planning", -- enum: decode f.active via GlobalOptionsetMetadata join — see quirks guide #enums
f.defaultdimension AS "RecId of the line's financial-dimension value set in DimensionAttributeValueSet"
FROM <catalog>.<schema>.forecastsales f
-- Dimension expansion: uncomment to resolve site / warehouse / location / batch
-- LEFT JOIN <catalog>.<schema>.inventdim id ON id.inventdimid = f.inventdimid AND id.dataareaid = f.dataareaid
-- Resolve DimensionAttributeValueSet (via DefaultDimension): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.dimensionattributevalueset dim ON dim.recid = f.defaultdimension
WHERE
f.dataareaid = '<company>'
-- AND f.itemid = '<ItemId>'
-- AND f.startdate >= '<DATE_FROM>' -- yyyy-MM-dd (UTC)
-- AND f.startdate <= '<DATE_TO>' -- yyyy-MM-dd (UTC)
ORDER BY f.modelid;6 parameters not filled: <catalog>, <schema>, <company>, <ItemId>, <DATE_FROM>, <DATE_TO>
Relationships
1-hop neighbors — click a table to navigate there. RecId and InventDim edges are highlighted; they’re the joins newcomers most often get wrong.
Join details
ON forecastsales.itemid = inventtable.itemidON forecastsales.inventdimid = inventdim.inventdimidON forecastsales.defaultdimension = dimensionattributevalueset.recid
Data Entities That Expose This Table
No standard export entity verified — land the raw table.