Sample output from the Price & Margin Realization Study prompt in the Sonar AI Prompt Library, run against a NetSuite test account. Every name and number here is test data. Back to the post · The library
TD3016323  ·  Commercial Analytics

Price & Margin Realization Study
Same SKU, Different Price: Segmentation vs. Inconsistency

Line-level analysis of realized price and gross margin across 121 SKUs, all customers, regions and sales reps — with leakage attribution and an annualized value model for bringing outliers to the defensible median.
ANALYSIS WINDOW: SEP 1, 2024 – AUG 22, 2026 (23.7 MONTHS)  ·  PREPARED: AUG 26, 2026  ·  SOURCE: NETSUITE PRODUCTION (SUITEQL, LINE LEVEL)
$2.11M
Product revenue analyzed
3,236 lines · 121 SKUs
97.0%
Avg. realized price
as % of list
$60
Total avoidable pricing
inconsistency found (1 line)
$25–63K
Annualized GP opportunity —
structural repricing, 14 SKUs

01Executive Summary

The headline question — is the same SKU being sold at materially different prices, and is that variance defensible? — has an unusually clean answer in this business: virtually all price variance is rational segmentation. Every SKU trades within a 6% band, and that band decomposes into exactly five discrete price tiers that are a deterministic function of line quantity. Across 3,236 lines and 23.7 months, exactly one line violates the schedule — and it runs in the company's favor (+$59.99).

The margin story is different. Because transactional discipline is airtight, the margin variance that exists is structural, not behavioral: it lives at the SKU level, not the deal level. Fourteen SKUs earn gross margins 15–46 points below their category medians — driven by supplier cost increases that were never passed through to list price. The Estes Park Chair now earns 2.6% gross margin; at its deepest volume tier it would sell below cost. Re-anchoring these 14 SKUs to defensible category medians is worth $24.8K–$63.4K of annualized gross profit, against ~$123K of annualized revenue on those SKUs.

Rational Segmentation
$33.4K / yr
Volume-tier discounts (3–6% off list, earned by quantity break). Systematic, uniform, defensible. 99.97% of all price variance.
Avoidable Inconsistency
≈ $0 / yr
One schedule violation in 23.7 months (INV03, +$59.99 overcharge). No rep favoritism, no ad-hoc discounting, no below-band deals.
Structural Mispricing
$25–63K / yr
14 SKUs priced below defensible margin medians after unpassed-through cost inflation. The real money is here — in the price file, not the sales floor.
Contents
02 — Price Variance: The Five-Tier Structure 03 — Customers, Regions, Reps: Testing for Favoritism 04 — Margin Bands, Discount Escalation & Drift Over Time 05 — Structural Outliers: Where Margin Actually Leaks 06 — Leakage Attribution & Annualized Value Model 07 — Recommendations 08 — Methodology, Assumptions & Data Quality 09 — Appendix: Source Queries

02Price Variance: The Five-Tier Structure

Every product line on every invoice and cash sale was expressed as a ratio of its unit price to the SKU's list price (the maximum observed sold price — validated against the tier structure). The entire dataset collapses into five discrete points with no scatter between them:

TierLine QuantityPrice (% of list)LinesRevenueGross MarginChannel
T1 — List1 – 4 units100%1,800$412,64246.5%Retail stores (SF, NY) + invoice
T25 – 9 units97%550$960,43343.3%Wholesale (LA DC, Miami)
T310 – 14 units96%388$389,84141.7%Wholesale
T415 – 19 units95%232$182,84539.4%Wholesale
T520+ units94%265$159,56345.8%Wholesale
Violation20 units @ 100%100%1$1,00040.0%INV03 — see Finding A
Tier margin differences reflect product mix (which SKUs sell in bulk), not discount depth — the 3–6% tier discount alone cannot move margin 7 points. T5's high margin is mix: high-margin apparel dominates 20+ unit orders.
Revenue by Price Tier — where the money actually trades
$413K $960K $390K $183K $161K T1 · list · qty 1–4 T2 · 97% · qty 5–9 T3 · 96% · qty 10–14 T4 · 95% · qty 15–19 T5 · 94% · qty 20+
Nearly half of product revenue trades at the first quantity break (T2, 97% of list). Deeper tiers are progressively rarer — the discount schedule is conservative by construction: maximum discount anywhere is 6%.
Finding A — The only schedule violation in 23.7 months

INV03 · Jul 25, 2026 · Susan Adams (no rep) · 20 × INV_Grey Cotton Hoodie @ $49.99 (list) — the quantity earned the 94% tier ($46.99/unit). The customer was overcharged $59.99. This is also the only product line in the dataset with a null location, indicating a manually keyed invoice that bypassed the pricing engine. Immaterial in dollars; material as a control observation — manual entry is the one door that bypasses the schedule.

03Customers, Regions, Reps: Testing for Favoritism

Regions: apparent regional pricing is channel mix

Stores (San Francisco loc 1, New York loc 3) transact 100% at list — every one of their 1,592 lines. The LA Distribution Center (loc 5) and Miami (loc 12) show 94–97% realization. This is not regional pricing: DCs take 5–35-unit wholesale orders and earn quantity breaks; stores ring 1–4-unit tickets. Within every location, tier tracks quantity exactly. Geography adds zero explanatory power once quantity is known.

Reps: a 0.26-point spread, fully mix-explained

Sales RepCustomersLinesRevenueRealized % of ListGross Margin
Tim Dietrich10890$1,010,73396.46%43.4%
Matt Fisher4680$717,79396.72%42.6%
Joel Williams274$124,56796.66%40.7%
(No rep — retail walk-in)661,607$254,616100.00%47.3%
Every rep's lines land exactly on the five-tier schedule. The 96.46–96.72% spread reflects order-size mix of their books, not negotiating behavior. Margin spread (40.7–43.4%) is product mix. No rep-level favoritism exists.

Customers: volume earns the price, nothing else does

Customer (top 12 by revenue)RepRevenue% of ListMargin
Jones ManufacturingT. Dietrich$316,49396.64%41.8%
Design Excellence Ltd.T. Dietrich$238,48796.06%43.6%
Panaderia Co.M. Fisher$224,00397.20%45.1%
Pineapple RepublicM. Fisher$203,43497.25%41.4%
Davis SuppliesT. Dietrich$194,68097.39%45.8%
Realpoint inc.M. Fisher$158,75096.17%39.9%
Recreational OutfittersM. Fisher$131,60695.75%43.4%
Marshall IndustriesJ. Williams$121,56796.58%40.6%
Hugo LimitedT. Dietrich$77,96494.88%47.4%
KarmabitT. Dietrich$64,43394.80%39.0%
Entenmanns LLCT. Dietrich$60,37697.94%45.3%
Blockster Inc.T. Dietrich$52,75096.17%38.4%
Realization range across major accounts: 94.8–97.9% — entirely a function of average order quantity. Hugo Limited and Karmabit sit lowest because they order in 20+ unit blocks (T5); Entenmanns highest because it orders in 5–9 unit blocks (T2). No negotiated or contract pricing exists anywhere in the book.

04Margin Bands, Discount Escalation & Drift Over Time

Below-band transaction test: zero findings

Each line's gross margin (net amount − costestimate) was compared to its SKU's median line margin. Result: not a single line falls more than 5 percentage points below its SKU's median — at either a 10-point or 5-point threshold, the outlier set is empty. There are no fire-sale deals, no margin-destructive one-offs, no quiet exceptions. Whatever margin variance exists within a SKU comes from the 3–6% tier schedule and from unit-cost changes over time — not from pricing behavior.

Discount escalation test: none

Realized price as a % of list is flat across the entire window — between 96.4% and 97.9% every single month, with no trend. Discounting is not deepening; the tier schedule has not crept.

Margin drift over time: stable, slightly rising

Monthly Blended Gross Margin % (red) vs. Realized Price as % of List (navy) — 24 months
50%46%42%38% 98.5%97.25%96% Sep 24Nov 24Jan 25 Mar 25May 25Jul 25 Sep 25Nov 25Jan 26 Mar 26May 26Jul 26 Gross margin % (left axis) Realized % of list (right axis) Trend: +0.62 pts/yr (regression)
Blended gross margin oscillates 40.4–48.9% (mix-driven month to month) around a slightly rising trend (+0.62 pts/yr). Realized price never leaves the 96.4–97.9% band. Neither series shows erosion — there is no discounting drift to correct.

The real drift is in cost, not price

23 SKUs show unit-cost variation greater than 5% within the window. Where cost rose and list price did not follow, margin compressed silently. Two exemplars:

Unit Cost as % of List Price — cost creep against a frozen price
90%55%20% Sep 24Jan 25May 25 Sep 25Jan 26May 26Aug 26 ■ Ghost Whisperer Thermal Jacket GR M — cost $32.50 → $65.00 (+100%); list frozen at $125; margin 74% → 48% The Bindel Jacket — cost $248.89 → $280 (+12.5%); list frozen at $319; margin 22% → 12%
Pattern: supplier cost steps up, list price does not respond, and gross margin absorbs the difference. This — not discounting — is the margin-drift mechanism in this business.

05Structural Outliers: Where Margin Actually Leaks

With transactional leakage ruled out, the defensible benchmark shifts from "SKU median line" to "category median SKU margin" — Apparel 46.2%, Beauty 51.9%, Home & Decor 48.6% (medians across 121 SKUs). Fourteen SKUs sit ≥15 points below their category median. These are pricing-file problems: cost moved, price didn't.

Highest-severity item
INV_Estes Park Chair — unit cost $307.50 vs. list price $324.00: 2.6% gross margin at best. At the T5 volume tier (94% of list = $304.56) this SKU would sell below cost. It has so far only traded down to T2 (97%), earning roughly $6.78 per $314 chair. Every unit sold is nearly margin-free floor space.
SKUCategoryAnn. RevenueCurrent MgnCat. MedianGap (pts)Uplift @ Half-GapUplift @ Median
INV_Estes Park ChairHome & Decor$12,9692.6%48.6%−46.0$4,015$11,615
INV_The Bindel JacketApparel$16,38310.5%46.2%−35.7$4,082$10,872
INV_The GentlemanBeauty$18,26727.7%51.9%−24.2$3,657$9,172
INV_Brown Leather SatchelApparel$19,49522.7%46.2%−23.5$3,491$8,511
INV_Black Leather JacketApparel$18,64628.7%46.2%−17.5$2,605$6,061
INV_Salida Backpack BUApparel$5,72817.1%46.2%−29.1$1,219$3,098
INV_Basil Lemon Hand WashBeauty$7,44532.0%51.9%−19.9$1,270$3,073
INV_Salida Backpack GRApparel$5,33917.1%46.2%−29.1$1,134$2,884
INV_Pro Essentials Brush SetBeauty$3,06025.4%51.9%−26.5$661$1,686
LOT_Aqua True CreamBeauty$4,01534.3%51.9%−17.6$621$1,470
INV_Rhinestone BlouseApparel$3,81226.1%46.2%−20.1$598$1,422
LOT_Scarlet ShimmerBeauty$2,74929.9%51.9%−22.0$513$1,259
INV_Black Leather BeltApparel$2,35018.5%46.2%−27.7$480$1,208
LOT_3-Tone Eye Shadow w/ MirrorBeauty$2,92034.1%51.9%−17.8$458$1,083
Total — 14 SKUs$123,179$24,804$63,414
"Uplift @ Half-Gap" reprices each SKU to close half the distance to its category median margin (price increases of 14–31%) — the conservative, demand-aware case. "Uplift @ Median" closes the full gap (price increases of 32–90%) — the theoretical ceiling, almost certainly demand-destructive for the worst items. Both assume constant unit volume and constant cost; see assumptions in §08.
Annualized GP Uplift by SKU — repricing to category median (full gap)
Estes Park Chair The Bindel Jacket The Gentleman Brown Leather Satchel Black Leather Jacket Salida Backpack BU Basil Lemon Hand Wash Salida Backpack GR Six further SKUs $11.6K $10.9K $9.2K $8.5K $6.1K $3.1K $3.1K $2.9K $8.1K (combined) $0 Scale: $11.6K max
Two SKUs in red — Estes Park Chair and Bindel Jacket — carry 35% of the total opportunity and are the two where cost inflation demonstrably outran a frozen list price.

06Leakage Attribution & Annualized Value Model

Attribution by the three requested dimensions, annualized (window factor 12 ÷ 23.7 months = 0.507):

Rational segmentation — volume-tier discounts (defensible, keep)
$33,360 / yr
Avoidable inconsistency — reps (schedule deviations, favoritism)
$0 / yr
Avoidable inconsistency — customers (unearned tiers, contract drift)
$0 / yr
Avoidable inconsistency — process (manual entry; 1 line, company-favorable)
+$30 / yr
Structural mispricing — SKU level (half-gap repricing, conservative)
$24,804 / yr
Structural mispricing — SKU level (full gap to category median, ceiling)
$63,414 / yr

Interpretation. "Bringing outliers to the defensible median" has no meaningful value at the transaction level — outlying transactions essentially do not exist. All recoverable value sits at the price-file level: 14 SKUs whose margins drifted 15–46 points below category norms as costs rose. The realistic, demand-aware capture is the half-gap case: ≈ $24.8K of annualized gross profit, concentrated in five SKUs that account for 74% of it. The full-gap ceiling of $63.4K requires price increases up to 90% and should be treated as an upper bound, not a target.

07Recommendations

  1. Reprice the two red SKUs immediately. Estes Park Chair (2.6% margin; below cost at T5 pricing) and The Bindel Jacket (10.5%) are economically broken. Even the conservative half-gap move (+31% / +25% price) is worth ~$8.1K/yr combined. If the market will not bear the price, the correct decision is discontinuation, not continued sale at cost.
  2. Institute a cost-passthrough trigger. The margin-drift mechanism here is frozen list prices absorbing supplier increases (Ghost Whisperer GR M cost +100%, price unchanged). Add a standing review: any SKU whose unit cost moves >5% flags for repricing. The 23-SKU cost-variation query in §09 is the ready-made detector.
  3. Close the manual-entry door. INV03 proves manually keyed invoices bypass the pricing schedule (and location coding). $60 today; the same door swings both directions. Require location + schedule validation on manual invoices, or a periodic run of the violation query in §09 (it returns exactly the exceptions, currently one row).
  4. Fix zero-cost item records. 23 lines (IT-* electronics accessories) carry no cost estimate and report 100% margin — invisible to any margin control. Populate purchase costs on these items.
  5. Protect the tier schedule — it is an asset. A five-tier, max-6% quantity-break structure applied with 99.97% fidelity across two years is rare discipline. Any future move to negotiated/contract pricing should be benchmarked against this baseline before it is allowed to erode.
  6. Do not chase rep-level pricing controls. The data shows zero rep discretion in pricing. Controls, dashboards or comp-plan changes aimed at "rep discounting" would address a problem this business does not have.

08Methodology, Assumptions & Data Quality

Scope & universe

All CustInvc and CashSale product lines (mainline='F', taxline='F'), Sep 1 2024 – Aug 22 2026. Elimination subsidiary (id 4, xElim) excluded via transactionline.subsidiary. Item types: InvtPart, NonInvtPart, Kit, Assembly. SKUs with ≥5 sold lines qualify for tier/median statistics (121 SKUs, 3,236 lines, $2.105M). Excluded: SVC_Delivery Service (per-job service charge, $241–$11,311 per line — dispersion is job scoping, not pricing) and 13 low-volume SKUs (<5 lines, $2.4K combined).

Key definitions

List price = maximum observed unit price per SKU across the window. Validated: every SKU's observed prices sit at exactly {100, 97, 96, 95, 94}% of this anchor, confirming it is the true list price rather than an outlier. Unit price = |netamount ÷ quantity|. Gross margin = (|netamount| − |costestimate|) ÷ |netamount|; transactionline.costestimate is NetSuite's line-level estimated COGS. Defensible median = (a) at transaction level, the SKU's median line margin; (b) at SKU level, the category median SKU margin (Apparel 46.2%, Beauty 51.9%, Home & Decor 48.6%). Annualization = window totals × 0.507 (12 ÷ 23.7 months).

Assumptions

(1) Repricing uplift assumes constant unit volume and constant unit cost — no demand elasticity is modeled; the half-gap scenario exists precisely to hedge this. (2) costestimate is taken as the cost of record; where it varies within a SKU, actual costing (avg/lot) drives real margin. (3) Cash sales without a customer-level rep are classified as retail walk-in; rep attribution uses customer.salesrep (transaction-level salesrep is not exposed to SuiteQL in this account). (4) Single-currency account (USD) — no FX effects. (5) No discount or markup line items exist in the O2C data (verified — zero rows), so line net amounts are complete realized prices.

Data quality observations

(i) 23 lines on IT-* electronics items carry zero costestimate → excluded from margin statistics, flagged in §07. (ii) One line (INV03) has null location. (iii) SER_Box Spring sells at a flat $500 to 3 customers, 145 lines, zero variance — a fixed-price add-on, no action. (iv) Several locations in this account share names; all location references use internal ids (1, 3, 5, 12).

09Appendix: Source Queries

All queries are SuiteQL, run against production Aug 26, 2026. The shared m subquery derives each SKU's list-price anchor.

Q1 — Price-tier decomposition (the five-tier discovery)
-- Every product line bucketed by unit price as a ratio of the SKU's list anchor
SELECT
    ROUND(ABS(tl.netamount / tl.quantity) / m.maxp, 2) AS price_ratio,
    CASE WHEN ABS(tl.quantity) >= 20 THEN 'T5' WHEN ABS(tl.quantity) >= 15 THEN 'T4'
         WHEN ABS(tl.quantity) >= 10 THEN 'T3' WHEN ABS(tl.quantity) >= 5  THEN 'T2'
         ELSE 'T1' END AS qty_tier,
    t.type AS channel,
    COUNT(*) AS line_count,
    ROUND(SUM(ABS(tl.netamount)), 2) AS revenue
FROM transaction t
JOIN transactionline tl ON tl.transaction = t.id
JOIN item i ON i.id = tl.item
JOIN (
    SELECT tl2.item AS item_id, MAX(ABS(tl2.netamount / tl2.quantity)) AS maxp
    FROM transaction t2
    JOIN transactionline tl2 ON tl2.transaction = t2.id
    WHERE t2.type IN ('CustInvc','CashSale') AND tl2.mainline = 'F' AND tl2.taxline = 'F'
      AND tl2.subsidiary <> 4 AND tl2.quantity <> 0 AND tl2.netamount <> 0
    GROUP BY tl2.item HAVING COUNT(*) >= 5
) m ON m.item_id = tl.item
WHERE t.type IN ('CustInvc','CashSale') AND tl.mainline = 'F' AND tl.taxline = 'F'
  AND tl.subsidiary <> 4 AND tl.quantity <> 0 AND tl.netamount <> 0
  AND i.itemtype IN ('InvtPart','Kit','Assembly','NonInvtPart') AND i.id <> 284
GROUP BY ROUND(ABS(tl.netamount / tl.quantity) / m.maxp, 2), qty_tier, t.type
ORDER BY 1, 2, 3
Q2 — Schedule-violation detector (returns current exceptions; run periodically)
-- Lines whose realized ratio deviates >0.5% from the tier their quantity earns
SELECT t.tranid, t.type, t.trandate, c.entityid AS customer, i.itemid AS sku,
       ABS(tl.quantity) AS qty, ROUND(ABS(tl.netamount / tl.quantity), 2) AS unit_price,
       loc.id AS location_id, loc.name AS location_name
FROM transaction t
JOIN transactionline tl ON tl.transaction = t.id
JOIN customer c ON c.id = t.entity
JOIN item i ON i.id = tl.item
LEFT JOIN location loc ON loc.id = tl.location
JOIN ( /* list-anchor subquery m, as in Q1 */ ) m ON m.item_id = tl.item
WHERE t.type IN ('CustInvc','CashSale') AND tl.mainline = 'F' AND tl.taxline = 'F'
  AND tl.subsidiary <> 4 AND tl.quantity <> 0 AND tl.netamount <> 0
  AND i.itemtype IN ('InvtPart','Kit','Assembly','NonInvtPart') AND i.id <> 284
  AND ABS( ABS(tl.netamount / tl.quantity) / m.maxp -
        CASE WHEN ABS(tl.quantity) >= 20 THEN 0.94 WHEN ABS(tl.quantity) >= 15 THEN 0.95
             WHEN ABS(tl.quantity) >= 10 THEN 0.96 WHEN ABS(tl.quantity) >= 5 THEN 0.97
             ELSE 1 END ) > 0.005
ORDER BY t.trandate
Q3 — Below-band margin test (SKU-median benchmark; currently returns zero rows)
-- Lines >5 margin points below their SKU's median line margin, with GP gap costed
SELECT t.tranid, c.entityid AS customer, i.itemid AS sku,
       ROUND(100 * (ABS(tl.netamount) - ABS(tl.costestimate)) / ABS(tl.netamount), 1) AS line_mgn_pct,
       med.med_mgn,
       ROUND(ABS(tl.netamount) * med.med_mgn / 100
             - (ABS(tl.netamount) - ABS(tl.costestimate)), 2) AS gp_gap_to_median
FROM transaction t
JOIN transactionline tl ON tl.transaction = t.id
JOIN customer c ON c.id = t.entity
JOIN item i ON i.id = tl.item
JOIN (
    SELECT tl2.item AS item_id,
           MEDIAN(100 * (ABS(tl2.netamount) - ABS(tl2.costestimate)) / ABS(tl2.netamount)) AS med_mgn
    FROM transaction t2 JOIN transactionline tl2 ON tl2.transaction = t2.id
    WHERE t2.type IN ('CustInvc','CashSale') AND tl2.mainline = 'F' AND tl2.taxline = 'F'
      AND tl2.subsidiary <> 4 AND tl2.quantity <> 0 AND tl2.netamount <> 0
      AND tl2.costestimate IS NOT NULL AND tl2.costestimate <> 0
    GROUP BY tl2.item HAVING COUNT(*) >= 5
) med ON med.item_id = tl.item
WHERE t.type IN ('CustInvc','CashSale') AND tl.mainline = 'F' AND tl.taxline = 'F'
  AND tl.subsidiary <> 4 AND tl.quantity <> 0 AND tl.netamount <> 0
  AND tl.costestimate IS NOT NULL AND tl.costestimate <> 0
  AND i.itemtype IN ('InvtPart','Kit','Assembly','NonInvtPart') AND i.id <> 284
  AND 100 * (ABS(tl.netamount) - ABS(tl.costestimate)) / ABS(tl.netamount) < med.med_mgn - 5
Q4 — Monthly margin & realization trend
SELECT TO_CHAR(t.trandate, 'YYYY-MM') AS mo,
       ROUND(100 * (SUM(ABS(tl.netamount)) - SUM(ABS(tl.costestimate)))
             / SUM(ABS(tl.netamount)), 2) AS mgn_pct,
       ROUND(100 * SUM(ABS(tl.netamount)) / SUM(ABS(tl.quantity) * m.maxp), 2) AS realized_pct_of_list
FROM transaction t
JOIN transactionline tl ON tl.transaction = t.id
JOIN item i ON i.id = tl.item
JOIN ( /* list-anchor subquery m */ ) m ON m.item_id = tl.item
WHERE /* standard universe filters as in Q1 */
GROUP BY TO_CHAR(t.trandate, 'YYYY-MM')
ORDER BY 1
Q5 — Cost-variation detector (feeds the passthrough trigger, Rec. 02)
-- SKUs whose unit cost varied >5% within the window, with best/worst margin at list
SELECT i.itemid AS sku,
       ROUND(MIN(ABS(tl.costestimate / tl.quantity)), 2) AS min_unit_cost,
       ROUND(MAX(ABS(tl.costestimate / tl.quantity)), 2) AS max_unit_cost,
       ROUND(MAX(ABS(tl.netamount / tl.quantity)), 2) AS list_price,
       ROUND(100 * (1 - MAX(ABS(tl.costestimate / tl.quantity))
                      / MAX(ABS(tl.netamount / tl.quantity))), 1) AS worst_mgn_pct
FROM transaction t
JOIN transactionline tl ON tl.transaction = t.id
JOIN item i ON i.id = tl.item
WHERE /* standard universe filters + costestimate present */
GROUP BY i.itemid
HAVING COUNT(*) >= 5
   AND MAX(ABS(tl.costestimate / tl.quantity)) > MIN(ABS(tl.costestimate / tl.quantity)) * 1.05
ORDER BY MAX(ABS(tl.costestimate / tl.quantity)) / MIN(ABS(tl.costestimate / tl.quantity)) DESC
Q6 — Rep / customer realization rollups (§03 tables)
-- Rep rollup; swap the GROUP BY to c.entityid for the customer view
SELECT COALESCE(e.entityid, '(no rep assigned)') AS rep,
       COUNT(DISTINCT c.id) AS custs, COUNT(*) AS ln,
       ROUND(SUM(ABS(tl.netamount)), 0) AS rev,
       ROUND(100 * SUM(ABS(tl.netamount)) / SUM(ABS(tl.quantity) * m.maxp), 2) AS pct_of_list,
       ROUND(100 * (SUM(ABS(tl.netamount)) - SUM(ABS(tl.costestimate)))
             / SUM(ABS(tl.netamount)), 1) AS mgn_pct
FROM transaction t
JOIN transactionline tl ON tl.transaction = t.id
JOIN customer c ON c.id = t.entity
LEFT JOIN employee e ON e.id = c.salesrep
JOIN item i ON i.id = tl.item
JOIN ( /* list-anchor subquery m */ ) m ON m.item_id = tl.item
WHERE /* standard universe filters */
GROUP BY COALESCE(e.entityid, '(no rep assigned)')
ORDER BY rev DESC
Q7 — Category median benchmarks & structural outliers (§05)
-- Category medians across per-SKU margins (>=5 lines, cost present)
SELECT s.category, ROUND(MEDIAN(s.mgn_pct), 1) AS cat_median_mgn, COUNT(*) AS sku_count
FROM (
    SELECT COALESCE(cl.name, '(none)') AS category, i.itemid AS sku,
           100 * (SUM(ABS(tl.netamount)) - SUM(ABS(tl.costestimate)))
               / SUM(ABS(tl.netamount)) AS mgn_pct
    FROM transaction t
    JOIN transactionline tl ON tl.transaction = t.id
    JOIN item i ON i.id = tl.item
    LEFT JOIN classification cl ON cl.id = tl.class
    WHERE /* standard universe filters + costestimate present */
    GROUP BY COALESCE(cl.name, '(none)'), i.itemid
    HAVING COUNT(*) >= 5
) s
GROUP BY s.category
ORDER BY s.category
-- Outliers: per-SKU margins >=15 pts below these medians (14 SKUs) were repriced in a
-- computation layer: new_revenue = cost / (1 - target_margin); uplift = Δrevenue × 0.507 (annualization).
DISCLAIMERS & LIMITATIONS. Margin figures use NetSuite line-level cost estimates (transactionline.costestimate), which may differ from posted COGS under actual/average costing. List price is inferred as the maximum observed sold price per SKU and validated against the observed tier lattice; no price-level master file was consulted. Repricing scenarios assume static volume and cost and are directional estimates, not forecasts; demand elasticity is explicitly unmodeled. Rep attribution follows customer.salesrep (transaction-level rep is not exposed to SuiteQL in this account). Analysis covers CustInvc and CashSale only; returns/credits are outside scope. Annualization factor 0.507 (12 ÷ 23.7 months). Prepared by Sonar AI from NetSuite production data, account TD3016323, Aug 26, 2026. Figures rounded; components may not sum exactly.
TD3016323 · COMMERCIAL ANALYTICS · SONAR AI