Loading...

Benchmark Store OSA Declines

In weekly district scorecard reviews, the district manager has to determine whether a store's sales risk comes from a local availability problem or a district-wide drift. This workflow assembles the store's current and prior OSA comparison against the district median and produces a variance table with a one-sentence direction of change.

The manager still decides whether the issue needs store coaching, merchandising support, or broader escalation; the workflow removes the data gathering, comparison, and formatting work. The estimated impact is a 30.0% shift in role time from execution-layer work to higher-value decision making.

Interactive Demo

See the Decision Intelligence Workflow in Action

This workflow handles a recurring comparative analysis task inside weekly store review: calculate a focal store's on-shelf availability for the current period, calculate the prior equal-length period, benchmark both against the district median store, and present the variance in a format that can be used in scorecards and store action plans. The execution work is mechanical but time-consuming because it requires consistent period logic, peer-set benchmarking, threshold evaluation, and presentation-ready output.

👤
Designed for line-of-business leaders — specifically the District/Regional Manager responsible for store performance review, inventory availability oversight, and merchandising escalation. It addresses a narrow operational burden: proving whether one store's OSA deterioration is real, material, and unique versus district peers. Why this matters: What line-of-business leaders actually need from AI →
Decision Intelligence Playground · Store OSA Variance Review
KWF Runtime
Start with an example
Want to see this OSA review workflow in your environment?
We will walk through the store-versus-district median analysis, the underlying availability data logic, and the scorecard-ready output your managers would receive. We will also map the workflow to your operating cadence and show it running on your Databricks environment.
Schedule a Databricks Session
How It Works

What the Decision Intelligence Workflow Does

This workflow handles a recurring comparative analysis task inside weekly store review: calculate a focal store's on-shelf availability for the current period, calculate the prior equal-length period, benchmark both against the district median store, and present the variance in a format that can be used in scorecards and store action plans. The execution work is mechanical but time-consuming because it requires consistent period logic, peer-set benchmarking, threshold evaluation, and presentation-ready output.

Click any step below to see the business logic, data query, and sample output for that step of the workflow.

Pre-specified logic, not runtime guessing — Most AI agent frameworks work by figuring things out on the fly. These Decision Intelligence workflows work differently. The Knowledge Work Foundry analyzes the cognitive labor pattern before deployment and encodes the decision logic directly into the configuration — which tables to query, which thresholds define a breach, how signals are ranked, and what the output artifact should contain. That analysis happens once. By the time the workflow runs, there is nothing left to figure out.
1
Store OSA
Calculates the focal store's on-shelf availability for the current analysis window and the prior equal-length period.
↑ click a step to explore the logic, query, and output
1
Step Detail

                      

                    

The workflow produces a variance table showing OSA% by period, change versus prior period in percentage points, district median OSA%, and variance versus the district median. It also produces a short direction statement such as whether the store is deteriorating, below district baseline, or both.

What this workflow does NOT do: It does not decide whether to escalate the store to merchandising or supply chain leadership, determine whether the root cause is replenishment versus shelf execution, adjust staffing or cycle count schedules at the store, approve emergency shipments or overrides, or set the district's OSA target and lost-sales risk thresholds.
Under the Hood

Data Warehouse Integration

The workflow reads directly from the store daily availability rollup and applies a repeatable comparison logic to the focal store and its district peer set. That removes the manual export-and-reconcile cycle that often delays weekly review meetings and creates inconsistent baselines from one store discussion to the next.

Although the calculation uses one analytical source here, the business question is cross-functional because the result is used by store operations, merchandising, and inventory teams to determine whether to pursue local remediation or district-level escalation.

Source system: Planogram and shelf availability daily rollup  ·  Domain: Store Operations and Inventory
Role in this workflow: This table provides the daily in-stock numerator, assortment denominator, and shelf out-of-stock event counts needed to calculate on-shelf availability for both the focal store and the district peer group. In this workflow, it is the sole operational signal source used to determine whether a store's availability has deteriorated over time and whether that deterioration is unique relative to the district median. When the current OSA falls below threshold or below the district baseline, the table's aggregated output supports escalation into merchandising review.
CREATE TABLE pura_vida_foods_dev.inventory_mart.mart_store_daily_availability (
  store_id STRING,
  region_id STRING,
  business_date DATE,
  osa_numerator_in_stock INT,
  osa_denominator_assortment INT,
  shelf_oos_events INT
);

WITH store_period AS (
  SELECT
    store_id,
    region_id,
    period_label,
    CASE
      WHEN SUM(osa_denominator_assortment)=0 THEN NULL
      ELSE SUM(osa_numerator_in_stock)*1.0/SUM(osa_denominator_assortment)
    END AS osa_rate
  FROM (
    SELECT
      store_id,
      region_id,
      business_date,
      osa_numerator_in_stock,
      osa_denominator_assortment,
      CASE
        WHEN business_date BETWEEN string">'{start_date}' AND string">'{end_date}' THEN string">'current'
        WHEN business_date BETWEEN date_add(string">'{start_date}', -datediff(string">'{end_date}',string">'{start_date}')-1)
                           AND date_add(string">'{end_date}',   -datediff(string">'{end_date}',string">'{start_date}')-1)
        THEN string">'prior'
        ELSE NULL
      END AS period_label
    FROM pura_vida_foods_dev.inventory_mart.mart_store_daily_availability
    WHERE region_id = string">'{region_id}'
      AND (
        business_date BETWEEN string">'{start_date}' AND string">'{end_date}'
        OR business_date BETWEEN date_add(string">'{start_date}', -datediff(string">'{end_date}',string">'{start_date}')-1)
                           AND date_add(string">'{end_date}',   -datediff(string">'{end_date}',string">'{start_date}')-1)
      )
  ) d
  WHERE period_label IS NOT NULL
  GROUP BY store_id, region_id, period_label
),
median_period AS (
  SELECT
    region_id,
    period_label,
    median(osa_rate) AS district_median_osa
  FROM store_period
  GROUP BY region_id, period_label
),
focus AS (
  SELECT * FROM store_period WHERE store_id = string">'{store_id}'
)
SELECT
  f.store_id,
  f.region_id,
  f.period_label,
  f.osa_rate,
  m.district_median_osa,
  (f.osa_rate - m.district_median_osa) AS delta_vs_median
FROM focus f
JOIN median_period m
  ON f.region_id = m.region_id AND f.period_label = m.period_label
ORDER BY f.period_label;
Cognitive Labor Analysis

Where the Work Sits in the Labor Stack

Not all cognitive labor is equally automatable. The KWF analysis breaks the workflow into three layers — execution, judgment, and strategic — and maps each step to the layer it belongs to. Execution-layer work is automatable. Judgment and strategic work stays with the manager.

Execution 50% Judgment 35% Strategic 15%
Execution Layer
50%
The execution layer retrieves the store and district availability data, computes current-versus-prior OSA rates, evaluates material variance thresholds, and formats the final variance table and direction statement.
Judgment Layer
35%
The manager interprets whether the variance reflects a true local store issue, weighs context from store conditions and merchandising plans, and decides what follow-up action to take.
Strategic Layer
15%
Strategic decisions such as changing replenishment policy, resetting district OSA expectations, or investing in broader process fixes remain with leadership.
Value Model

The Business Case for Automation

Time Recovered
30.0% role-time shift
Based on the candidate value model, automating the comparison and scorecard assembly work shifts 30.0% of role time away from execution tasks.
Annual Savings
6 leaders modeled
The planning model assumes six district or regional leaders with a fully loaded role cost of $140,000 each.
Strategic Upside
Faster inventory escalation
The strategic upside is shorter time-to-decision on whether a store needs targeted inventory support or broader district escalation.
Kill Question: Without this workflow, the district manager has to justify targeted inventory support through manual SKU checks, anecdotal shelf walks, and ad hoc analyst requests, which slows escalation and leaves meetings arguing about the baseline instead of the action.

Primary Valuation Metric: Reduction in time-to-decision for inventory escalation

Next Step

Run your own value estimate for district store review work — or talk to us about your in-store operations team.

The Cognitive Labor Value Calculator models team size, role cost, and automation coverage so you can estimate the operational value of removing repetitive analysis work. It takes under two minutes to complete.