Skip to content

Map Demand State

Map raw rows into the scenario's demand state table: the outcome of demand, how much was fulfilled at each location, and the revenue realized.

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

When to use this

  • The scenario is a baseline that should preserve observed fulfilment for later comparison
  • You're building a scenario for dashboards and want realized demand totals visible beside the optimization output

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
  • A fulfilled-quantity column or a realized-revenue 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 Fulfilled Quantity, and the panel marks it required once it is mapped.

Field Type Required Example What it is Auto-detected headers
Location text Yes Store 1 Where demand was served. 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
Fulfilled Quantity number No 90.0 Quantity actually delivered in the recorded baseline — the demand served, not the demand asked for; unserved demand is not in it. Must be greater than or equal to 0. Its unit goes in Quantity Unit. fulfilled_quantity, fulfilled, quantity, qty
Quantity Unit text No units Unit the fulfilled 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 Revenue number No 1080.0 Total revenue actually earned in the baseline (not per-unit) on the quantity delivered. Revenue, not margin; no cost is netted off it. Must be greater than or equal to 0. realized_revenue, revenue, sales, income, value

How it works

Each row becomes a demand state record. The scenario stores the realized totals so dashboards, the map and side-by-side comparisons can read what got served.

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 Demand Policy when building a baseline:

flowchart LR
    n1["Import Data (demand.csv)"] --> n2["Map Demand Policy"]
    n1 --> n3["Map Demand 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 Demand Policy. State is observation.
  • Mapping a per-unit rate here. Realized Revenue is a total. Per-unit revenue belongs on Map Demand 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.