extend.billOfMaterialsSteps
extend.billOfMaterialsSteps(), table function
Translates a demand history for items into the demand history for the parts,
but contrary to extend.billOfMaterials, it
includes all intermediate steps in the bill of materials.
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.billOfMaterialsSteps(
Item: Items.Id,
Part: BOM.PartId,
Quantity: BOM.Quantity,
DemandId: Orders.Uid,
DemandValue: Orders.Quantity)
show table "Expanded with steps" with
T.FinalProduct as "Final Product"
T.Component
T.Steps
T.DemandId
T.Quantity
This produces the following table:
| Final Product | Component | Steps | DemandId | Quantity |
|---|---|---|---|---|
| kit | kit | 0 | kit | 2 |
| kit | partA | 2 | kit | 6 |
| subkit | partA | 1 | subkit | 3 |
| kit | partB | 1 | kit | 4 |
| kit | subkit | 1 | kit | 2 |
| subkit | subkit | 0 | subkit | 1 |
Remarks
The table returned by extend.billOfMaterialsSteps includes all intermediate
components (not only leaf parts). It contains the same columns as
extend.billOfMaterials, plus FinalProduct,
Component, and Steps (the minimum number of manufacturing steps between
Component and FinalProduct).
Tables produced by extend.billOfMaterialsSteps default to a maximum size of
100m lines unless an explicit max constraint is provided.