Skip to content

Map Bill of Materials

Map raw rows into the scenario's bill of materials table: the recipe for each finished product, which components it consumes, and how many of each per unit of output.

A bill of materials is the structural backbone of production. Pair it with Map Production Policy, which says where a recipe can run and at what cost, and Map Production State, which records what was produced.

When to use this

  • Your network makes products rather than only moving them. Components are assembled into finished goods
  • You want Network Optimization and Cost to Serve to account for component consumption and the cost of finished goods

What you need

  • An upstream Import Data node with one row per (recipe, component) pair
  • The finished product, its components, and how many of each component go into one unit of output

Each recipe produces exactly one output product. The output columns repeat on every component row of the same recipe. Rows are grouped by recipe name.

Field mapping

Fields are matched by name unless you set them. When the workflow runs, every field you have not set a column for is matched against the headers listed below, case-insensitively and ignoring spaces around the header, and a space inside your header reads as an underscore, so Site Name matches site_name. Setting a column for one field fixes that field only; the others keep following your file's headers, so a renamed column is still found. A required field that no column supplies — no header matched, or you set none or one your table lacks — is reported once, with the headers your table does have.

Set mappings in the node's panel. Connect an upstream table and select the mapping node. A field matched by name is marked Matched by name; pick a column to set it yourself, and Match by name puts it back. Match all by name clears every field you set. Required fields without a match are marked in the panel.

Reshape rows in a Script first. A mapping node only says which column is which field. To drop rows, recode values, or split or combine columns, connect a Script node before it and map the columns the Script returns.

Same for every row. A file with no unit column still states its unit: in Output Unit or Component Unit, pick Same for every row and type the unit, such as bike, and every row is in it. Over MCP, set it in field_mappings as "output_unit": "__const__:bike". Output Unit and Component Unit are required on every row with Quantity per Output, and the panel marks them required once it is mapped.

Field Type Required Example What it is Auto-detected headers
Bom Name text Yes City Bike BoM Recipe name. All rows sharing this name form one Bill of Materials. bom_name
Output Product text Yes City Bike The finished product this recipe produces. Must be the same on every row of the recipe, and must match a Product name. output_product
Component Product text Yes Wheel A component consumed by this recipe. Must match a Product name. component_product
Quantity per Output number Yes 2.0 How many units of the component go into one unit of the output product. Must be greater than 0. quantity_per_output
Output Unit text Yes bike Unit the output product is counted in, repeated on every row of the recipe. A unit other than the scenario's needs a conversion for the product. output_unit
Component Unit text Yes piece Unit the component is counted in. A unit other than the scenario's needs a conversion for the product. component_unit

How it works

Rows are grouped by Bom Name into one recipe each. The per-unit coefficients tell the optimizer how much of each component a unit of the finished product consumes. Cost to Serve uses the same coefficients to roll component cost up into the finished good.

Workflow wiring

flowchart LR
    n1["Import Data (bom.csv)"] --> n2["Map Bill of Materials"]
    n4["Import Data (production.csv)"] --> n5["Map Production Policy"]
    n2 --> n3["Create Scenario"]
    n5 --> n3
    n6["Import Data (products.csv)"] --> n7["Map Products"]
    n7 --> n3
    n8["Import Data (locations.csv)"] --> n9["Map Locations"]
    n9 --> n3

Common mistakes

  • Several outputs in one recipe. Each recipe makes one finished product. Co-products are not modelled. Give each output its own recipe.
  • Disagreeing output columns within a recipe. Every row sharing a Bom Name must name the same Output Product. This node and Create Scenario save such rows as they are; Cost to Serve and Network Optimization refuse the recipe when they run, naming it.
  • Putting the production cost here. The per-unit conversion cost belongs on Map Production Policy, not on the recipe.

Messages this node can show

The table this node makes is checked again with the rest of the scenario when Create Scenario assembles it: see messages about the scenario.

A run gives this node 5 minutes. A node that takes longer stops with Time limit reached.

Like every node, it can also stop on the checks before a run and the run's limits.