extend.billOfMaterials
extend.billOfMaterials(), table function
Translates a demand history for items into the demand history for the parts.
See user guide.
Examples
table Items[Id] = with
[| as Id |]
[| "kit" |]
[| "subkit" |]
[| "partA" |]
[| "partB" |]
table BOM = with
[| as RawId, as PartId, as Quantity |]
[| "kit", "subkit", 1 |]
[| "kit", "partB", 2 |]
[| "subkit", "partA", 3 |]
expect BOM.Id = BOM.RawId
table Orders = with
[| as Uid, as Quantity |]
[| "kit", 2 |]
[| "subkit", 1 |]
expect Orders.Id = Orders.Uid
table T max 1k = extend.billOfMaterials(
Item: Items.Id,
Part: BOM.PartId,
Quantity: BOM.Quantity,
DemandId: Orders.Uid,
DemandValue: Orders.Quantity)
show table "Expanded" with
Items.Id
T.DemandId
T.Quantity
This produces the following table:
| Id | DemandId | Quantity |
|---|---|---|
| partA | kit | 6 |
| partA | subkit | 3 |
| partB | kit | 4 |
Remarks
Tables produced by extend.billOfMaterials default to a maximum size of 100m
lines unless an explicit max constraint is provided.