Skip to content

Map Supply State

Map raw rows into the scenario's supply state table: the outcome of supply, how much was used at each location, and the cost realized.

This is the output side of supply. Pair it with Map Supply Policy, the rules, on baselines you will compare against an optimization.

When to use this

  • The scenario is a baseline that should preserve observed supply history for later comparison
  • Cost to Serve allocates the realized cost on this table, so a per-customer breakdown needs it

Network Optimization does not read this table. It writes it fresh every run. Optimization-only workflows can skip this node.

What you need

  • An upstream Import Data node with one row per (location, product) you have observations for
  • An observed-quantity column or a realized-cost column, typically both

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 Quantity Unit, pick Same for every row and type the unit, such as units, and every row is in it. Over MCP, set it in field_mappings as "quantity_unit": "__const__:units". Quantity Unit is required on every row with Used Quantity, and the panel marks it required once it is mapped.

Field Type Required Example What it is Auto-detected headers
Location text Yes Warehouse A Where the supply was used from. Must match a Location name. location, loc, name, id, location_id, loc_id
Product text Yes Widget Product or SKU. Required — name it even in a single-product scenario. Must match a Product name. product, sku, item, material, product_id
Used Quantity number No 800.0 Quantity actually supplied in the recorded baseline — what was drawn from this supply point, not what it could have provided. Must be greater than or equal to 0. Its unit goes in Quantity Unit. used_quantity, quantity, qty, amount, volume, units
Quantity Unit text No units Unit the used quantity is in. Required on every row that carries one. A unit other than the scenario's needs a conversion for the product. quantity_unit, qty_unit, unit, uom
Realized Supply Cost number No 4000.0 Total supply cost actually incurred in the baseline (not per-unit) — what the goods themselves cost. The purchase side only; moving them is the transport cost, recorded separately and not in it. Negative amounts record credits against this cost. realized_cost, supply_cost, handling_cost, total_supply_cost, production_cost, total_handling_cost
Realized Emissions number No 120.0 Total emissions actually produced by this supply in the baseline, in the scenario's emissions unit, set on Create Scenario. Upstream of any movement; transport emissions are recorded separately and are not in it. Must be greater than or equal to 0. realized_emissions, emissions, co2, carbon, ghg, carbon_emissions

How it works

Each row becomes a supply state record. The scenario stores the realized totals so dashboards, the map and side-by-side comparisons can read what flowed, and so Cost to Serve has a supply cost to allocate.

An optimization overwrites this table. A run that solves recomputes the state and replaces what was there. A Scenario Script can rewrite it too. A scenario loaded and saved again without either keeps the rows it was carrying. That is what makes a mapped baseline a baseline, and why an observed table mapped here survives into the comparison you built it for.

Workflow wiring

Pair with Map Supply Policy when building a baseline:

flowchart LR
    n1["Import Data (supply.csv)"] --> n2["Map Supply Policy"]
    n1 --> n3["Map Supply State"]
    n4["Import Data (locations.csv)"] --> n5["Map Locations"]
    n6["Import Data (products.csv)"] --> n7["Map Products"]
    n2 & n3 & n5 & n7 --> n8["Create Scenario"]

Common mistakes

  • Wiring only this node and expecting the optimizer to use it. The optimizer reads Map Supply Policy. State is observation.
  • Mapping a per-unit cost here. Realized Supply Cost is a total. The per-unit rate belongs on Map Supply Policy.

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.