InventBatch
worksheet headerBatch master — one row per item and batch number, carrying expiry and manufacturing dates plus vendor batch details; the record behind the inventBatchId dimension
Keyed by itemId + inventBatchId (batch numbers are unique per item, not global). Pds* fields belong to Process manufacturing and are empty unless that module is used.
What the badges mean
- main
- Table group: how F&O categorizes the table's role — main entity, group/header, transaction, worksheet header, worksheet line, reference, parameter, or framework.
- Shared across companies
- The table carries no
DataAreaId— rows aren’t partitioned per company, so a query never needs (and can’t use) a company filter here (see the quirks guide). - Date-effective
- The table carries a
ValidFrom/ValidToeffectivity window — a join without a date filter multiplies every key by its history (see the quirks guide).
Fields
14 fields · 2 key
14 fields.
| Key | Field | EDT | Description | Type | Length | Flags |
|---|---|---|---|---|---|---|
| Key | inventBatchId | InventBatchId | The batch number — unique within the item, referenced by InventDim.inventBatchId | string | ||
| Key | itemId | ItemId | Item the batch belongs to — batch numbers are scoped to an item, so joins need both columns | string | ||
| description | Free-text description of the batch | string | ||||
| expDate | Expiration date of the batch; unset rows carry the 1900-01-01 sentinel | date | ||||
| prodDate | Manufacturing date of the batch; unset rows carry the 1900-01-01 sentinel | date | ||||
| PdsBestBeforeDate | Best-before date (process manufacturing); unset rows carry the 1900-01-01 sentinel | date | ||||
| PdsShelfAdviceDate | Shelf-advice date (process manufacturing); unset rows carry the 1900-01-01 sentinel | date | ||||
| PdsDispositionCode | Batch disposition code controlling whether the batch is usable, blocked, or restricted | string | ||||
| PdsVendBatchId | The vendor's own batch number for a purchased batch | string | ||||
| PdsVendBatchDate | Vendor batch (manufacturing) date; unset rows carry the 1900-01-01 sentinel | date | ||||
| PdsVendExpiryDate | Vendor expiry date; unset rows carry the 1900-01-01 sentinel | date | ||||
| PdsCountryOfOrigin1 | Country of origin recorded for the batch | string | ||||
| PdsFinishedGoodsDateTested | Date the finished-goods batch was tested; unset rows carry the 1900-01-01 sentinel | date | ||||
| ManufacturerId | RecId | RecId of the manufacturer's global-address-book party in DirPartyTable | int64 |
Field provenance: hand-curated.
Boilerplate SQL
Starting point for reading InventBatch on 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.
4 parameters not filled: <catalog>, <schema>, <company>, <ItemId>
-- ============================================================
-- Table : InventBatch Batch master — one row per item and batch number, carrying expiry and manufacturing dates plus vendor batch details; the record behind the inventBatchId dimension
-- Purpose: Column-selected read of InventBatch — auto-generated from field metadata
-- Grain : One row per company (dataareaid) + inventBatchId + 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
i.inventbatchid AS "The batch number — unique within the item, referenced by InventDim.inventBatchId",
i.itemid AS "Item the batch belongs to — batch numbers are scoped to an item, so joins need both columns",
i.description AS "Free-text description of the batch",
CASE WHEN CAST(i.expdate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.expdate AS DATE) END AS "Expiration date of the batch; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
CASE WHEN CAST(i.proddate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.proddate AS DATE) END AS "Manufacturing date of the batch; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
CASE WHEN CAST(i.pdsbestbeforedate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsbestbeforedate AS DATE) END AS "Best-before date (process manufacturing); unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
CASE WHEN CAST(i.pdsshelfadvicedate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsshelfadvicedate AS DATE) END AS "Shelf-advice date (process manufacturing); unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
i.pdsdispositioncode AS "Batch disposition code controlling whether the batch is usable, blocked, or restricted",
i.pdsvendbatchid AS "The vendor's own batch number for a purchased batch",
CASE WHEN CAST(i.pdsvendbatchdate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsvendbatchdate AS DATE) END AS "Vendor batch (manufacturing) date; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
CASE WHEN CAST(i.pdsvendexpirydate AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsvendexpirydate AS DATE) END AS "Vendor expiry date; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
i.pdscountryoforigin1 AS "Country of origin recorded for the batch",
CASE WHEN CAST(i.pdsfinishedgoodsdatetested AS DATE) = DATE '1900-01-01' THEN NULL ELSE CAST(i.pdsfinishedgoodsdatetested AS DATE) END AS "Date the finished-goods batch was tested; unset rows carry the 1900-01-01 sentinel", -- 1900-01-01 sentinel → NULL
i.manufacturerid AS "RecId of the manufacturer's global-address-book party in DirPartyTable"
FROM <catalog>.<schema>.inventbatch i
-- Resolve DirPartyTable (via ManufacturerId): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.dirpartytable dir ON dir.recid = i.manufacturerid
WHERE
i.dataareaid = '<company>'
-- AND i.itemid = '<ItemId>'
ORDER BY i.inventbatchid;Verified September 2026
Relationships
Diagram of 1-hop neighbors — join details below. RecId and InventDim edges are highlighted; they’re the joins newcomers most often get wrong.
Join details
ON inventbatch.itemid = inventtable.itemid AND inventbatch.dataareaid = inventtable.dataareaidON inventbatch.manufacturerid = dirpartytable.recidON inventdim.inventbatchid = inventbatch.inventbatchid AND inventdim.dataareaid = inventbatch.dataareaid
Data Entities That Expose This Table
More Inventory tables
- InventDimThe inventory dimension hub — one row per unique combination of site, warehouse, location, batch, and serial that every stock quantity hangs off by InventDimId
- InventItemPriceItem price records — activated cost, purchase, and sales prices per item, costing version, and dimension; the source for standard-cost analysis
- InventJournalTableInventory journal header — one row per movement, adjustment, transfer, BOM, or counting journal, with its type, posting status, and line count
- InventJournalTransInventory journal line — one row per item movement in a journal, with quantity, cost, counted figures, and the dimension combination it posts against
- InventLocationWarehouse master — one row per warehouse (inventory location) with its site and type
- InventSiteSite master — one row per operational site, the top of the inventory dimension hierarchy that warehouses roll up to