Skip to content

Allocation Overview KPIs

Open Overview > Allocation. The cards summarize the latest completed allocation run for the selected pipeline and supply scenario. They report what the allocator assigned among the supplies it could use, not what customers have physically received. Set the View toolbar to Quantity to compare the cards to the units in the queries below.

Read the Eight Cards

Card What the value counts What clicking it shows
Fill Rate Allocated units divided by allocated plus shortfall units. This is unit fill, not the percentage of demand rows fully served. An empty denominator displays 0%. Fully filled demand rows only.
Allocated Qty Units assigned to demand, summed over the demand-to-supply allocation lines. Does not filter.
Total Backlog Units still short in this run's planning horizon, including the unfilled portion of partially filled demands. This is not just overdue ERP orders. All demand rows with shortfall.
Unmet Demands Demand rows that received nothing. Does not include partially filled rows. Unfulfilled demand rows only.
Partially Filled Demand rows that received some but not all requested units. Partially filled demand rows only.
Protected Inv. Units fenced at the start of this run for future high-priority requests. Starting reserved quantity per supply is capped at that supply's available quantity. This is neither safety stock nor the remaining reservation at the end. Does not filter.
Routing Violations Allocation lines that were used despite a positive soft routing penalty. A hard exclusion prevents the line from being allocated and does not increment this card. Demand rows with at least one flagged allocation line.
Fair-Share Issues Allocation lines for customer classes (or other configured groups) whose final share of grouped units was over target by more than its tolerance, with a positive configured diagnostic penalty. This is not a count of customer classes, and soft reporting does not change the allocation rank. Demand rows with at least one flagged allocation line.

A demand row in the normal weekly run represents a netted item/site/week, not necessarily one order or customer. The same demand can have multiple allocation lines and count more than once toward the two policy cards. The demand list shows that row only once. The quantity cards are rounded to whole units in the API and abbreviated in the browser. In value view, they use an estimate: the quantity times the average master unit cost of items with fulfilled lines in this run, with currency conversion. Suppliers' actual order values are not summed.

If a segment is selected, the ClickHouse quantity and policy-line aggregates are restricted to matching pairs. The stored Protected Inv., Unmet Demands, and Partially Filled metrics remain run-wide. Clear the segment to reconcile all the cards and the grid against the whole run.

How to Trigger Each Policy Signal

  • Protected inventory: Enable reservations and put a demand at or above the configured priority in the lookahead window. It must be due after the allocation clock date and have matching supply at the same item/site. A request due today is not fenced. Reserve request × (1 + safety margin) among matching sources; the starting pools actually held by the engine are capped per supply.
  • Routing violations: Configure a default routing policy with a positive soft penalty, and give a demand eligible supply that misses a preference, for example a non-preferred location. The allocator matches candidate sources by item and allocation site; a preference does not create a lane or move stock between sites. An explicit policy on a demand takes precedence over the scenario default. An unused or hard-blocked candidate is not counted.
  • Fair-share issues: Enable fairness, choose a demand grouping supported by your data, and use target keys matching actual group values. For example, {"professional": 1, "amateur": 1} means 50/50. If the professional class receives all 50 allocated units, it reaches 100%. With a 5-percentage-point tolerance, all used lines for that class are flagged. The unserved amateur demands show in Unmet Demands, not as fair-share allocation lines. The optional hard cap is applied during allocation; the card reports the final result.

Read-Only SQL

1. PostgreSQL: Get the run's keys and the three run-wide metrics. Bind :pipeline_id and :supply_scenario_id using your SQL client. scenario is the tenant's PostgreSQL schema in this example. The scenario_id on results is the supply scenario, not the allocation_scenario_id that owns the policies.

SELECT id AS run_id, pipeline_id, scenario_id, archive_date,
       (metrics->>'demands_unfilled')::int AS unmet_demands,
       (metrics->>'demands_partially_filled')::int AS partially_filled,
       trunc((metrics->>'total_reserved_qty')::numeric) AS protected_inventory,
       allocation_scenario_id
FROM scenario.allocation_run
WHERE pipeline_id = :pipeline_id
  AND scenario_id = :supply_scenario_id
  AND status = 'completed'
ORDER BY started_at DESC
LIMIT 1;

A missing total_reserved_qty means the run predates reservation telemetry; PostgreSQL returns NULL here even though the compatibility display can show 0. The original starting fence quantity cannot be recovered from the allocation lines alone.

2. ClickHouse: Substitute the run keys returned by PostgreSQL. This reproduces the other five cards in Quantity view, before display formatting. The unrounded quantities are used to compute fill rate.

WITH
    a AS (
        SELECT sum(allocated_qty) AS allocated_units,
               countIf(penalty_routing > 0) AS routing_violations,
               countIf(penalty_fairness > 0) AS fair_share_issues
        FROM PIPE_allocation_results
        WHERE pipeline_id = {pid:Int64} AND scenario_id = {sid:Int64}
          AND archive_date = {ad:Date} AND run_id = {rid:Int64}
    ),
    u AS (
        SELECT sum(shortfall_qty) AS backlog_units
        FROM PIPE_allocation_unfulfilled
        WHERE pipeline_id = {pid:Int64} AND scenario_id = {sid:Int64}
          AND archive_date = {ad:Date} AND run_id = {rid:Int64}
    )
SELECT if(allocated_units + backlog_units > 0,
          round(allocated_units / (allocated_units + backlog_units), 4), 0) AS fill_rate,
       allocated_units, backlog_units, routing_violations, fair_share_issues
FROM a CROSS JOIN u;

Do not join individual allocation and shortfall rows before summing: a demand filled from two supply lines would repeat its shortfall. Query PIPE_allocation_results at the (demand_id, supply_id) grain for routing and fair-share evidence; query PIPE_allocation_unfulfilled at the demand_id grain for requested, filled, and shortfall units.

Implementation: alloc_overview_kpis and alloc_overview_demands in files/api/main.py; write_results_ch in files/allocation_runner.py; the native engine in files/supply/src/score_alloc/engine.rs.