Part IV — Business workflows · Chapter 12
Peer benchmarks from every 10-K
And how often last year's numbers change
Built from the SEC's XBRL extracts of every 10-K, an industry benchmark for fiscal 2025 shows the typical semiconductor company earning 2 cents of operating profit per dollar of revenue while the industry as a whole earned 35. One company in seven later changed a prior-year figure.
In fiscal 2025 the median semiconductor company earned 2.3 cents of operating profit on each dollar of revenue. Add up the whole group and it earned 35 cents, because NVIDIA alone took 67% of the group's operating income. Which of those two numbers a company should be held against depends on the question. Both come out of the same table, built here from the SEC's own extracts of every 10-K, the annual report each US-listed company files.
The table is the starting point of a peer benchmark, the analysis an equity analyst, a CFO's planning team or a board compensation committee runs to place one company among others. The chapter builds it for 2,143 operating companies in 18 industries. Along the way it measures how often the figures it is built on change: 13.7% of companies reported at least one of eight fiscal 2024 figures differently a year later.
The median semiconductor company earned 2.3 cents per dollar of revenue; the industry as a whole earned 35
- Median company
- Whole industry (pooled)
| Semiconductors, median company | 2.3% |
|---|---|
| Semiconductors, whole industry | 35.1% |
| Software and IT services, median company | 2.6% |
| Software and IT services, whole industry | 28.1% |
| Computers and electronics, median company | 3.1% |
| Computers and electronics, whole industry | 18.4% |
| Pharmaceuticals and biotech, median company | -3.8% |
| Pharmaceuticals and biotech, whole industry | 12.9% |
| Utilities, median company | 20.2% |
| Utilities, whole industry | 20.7% |
What the SEC extracts contain
Since 2011 every 10-K has carried its financial statements in XBRL, a markup in which each number is tagged with a line item from a standard taxonomy (Revenues, NetIncomeLoss, Assets), a date and a unit. Each quarter the SEC publishes every number from that quarter's filings as four tab-separated files. Two are used here: sub.txt, one row per filing with the company, its industry code and the balance-sheet date, and num.txt, one row per number.
From quarterly extracts to a company-year table
Read thirteen zips in one query
A glob inside the zip path reads the same file from every quarter, and
filename = truerecords which quarter each row came from. A few segment descriptions contain a tab, so those fields are quoted; everything is read as text and cast later.10_load.sqlSQL CREATE OR REPLACE MACRO sec_file(name) AS TABLE SELECT regexp_extract(filename, '(\d{4}q\d)', 1) AS quarter, * EXCLUDE (filename) FROM read_csv('zip://' || getvariable('raw_dir') || '20*q*.zip/' || name, delim = '\t', quote = '"', all_varchar = true, filename = true);87,326 filings, 17,238 of them 10-Kschapters/14-peer-benchmarks/pipeline/10_load.sql
Keep one annual report per company and fiscal year
Fiscal years follow Compustat's convention: a year ending in June or later is named for that calendar year, one ending January to May for the year before, so Walmart's year to January 2025 and Apple's to September 2024 are both fiscal 2024. Amendments (828 10-K/A filings) are left out.
10_load.sqlSQL SELECT *, fiscal_year(period) AS fy, industry(sic) AS industry FROM filings WHERE form = '10-K' AND fiscal_year(period) BETWEEN 2023 AND 2025 QUALIFY row_number() OVER (PARTITION BY cik, fiscal_year(period) ORDER BY filed DESC, accepted DESC) = 1;16,807 reportschapters/14-peer-benchmarks/pipeline/10_load.sql
Keep consolidated dollar amounts with standard tags
A 10-K reports most figures several times: for the whole company, for each segment, sometimes for a subsidiary that co-signs. Leaving out rows with a segment or co-registrant keeps the consolidated figure, and
checks.sqlconfirms that one value remains per report, tag, date and duration.10_load.sqlSQL WHERE n.uom = 'USD' AND n.version LIKE 'us-gaap/%' AND n.segments IS NULL AND n.coreg IS NULL AND n.qtrs IN ('0', '4')3,271,421 numberschapters/14-peer-benchmarks/pipeline/10_load.sql
Map tags to line items, then PIVOT
Revenue appears under several tags. A priority list picks one per report with
arg_min, andPIVOTturns the long list of line items into one row per company and year.20_model.sqlSQL SELECT fy, cik, item, ddate, arg_min(value, priority) AS value FROM facts JOIN item_tags USING (tag) GROUP BY ALL; PIVOT (SELECT fy, cik, item, value FROM item_values WHERE ddate = period) ON item IN ('revenue', 'operating_income', 'net_income', 'rd', 'cfo', 'capex', 'assets', 'equity') USING any_value(value);4,032 reports with revenuechapters/14-peer-benchmarks/pipeline/20_model.sql
Revenue has no single tag
The tag Revenues covers only 30% of fiscal 2025 reports. Since the 2018 revenue-recognition standard, more companies use RevenueFromContractWithCustomerExcludingAssessedTax, which 2,164 reports carry. All five tags in the list together reach 74%. The rest are mostly banks, which report interest income instead, shell companies and drug developers with no sales yet.
The typical company and the industry total
A median describes the typical company; a pooled margin (total operating income over total revenue) describes where the industry's money is. In industries with one dominant earner they diverge. Semiconductors is the extreme case, and software is close behind: the median software company's margin was 2.6%, the pooled margin 28.1%, with Alphabet earning 31% of the group's operating income. In utilities, where prices are set by regulators, the two agree to within a point (20.2% and 20.7%).
Utilities have the highest median operating margin, 20.2%, and pharmaceuticals the lowest, -3.8%, with 56% of drug companies running an operating loss
| Utilities | 20.2% | 13.0% to 26.1% |
|---|---|---|
| Other manufacturing | 7.3% | 0.3% to 14.1% |
| Food, beverages, tobacco | 7.1% | 2.1% to 12.3% |
| Other services | 7.1% | -0.2% to 15.8% |
| Oil and gas | 6.8% | 1.5% to 21.0% |
| Construction | 6.7% | 1.2% to 10.1% |
| Transportation | 6.0% | 2.1% to 15.7% |
| Retail and restaurants | 4.0% | -0.4% to 8.4% |
| Chemicals | 3.5% | -7.1% to 13.5% |
| Mining | 3.5% | -3.4% to 18.3% |
| Wholesale | 3.5% | 1.3% to 7.3% |
| Computers and electronics | 3.1% | -3.4% to 11.6% |
| Software and IT services | 2.6% | -9.8% to 13.1% |
| Health services | 2.5% | -7.9% to 9.8% |
| Semiconductors | 2.3% | -10.6% to 17.0% |
| Telecom and media | 2.0% | -15.2% to 12.8% |
| Medical devices | 1.2% | -18.5% to 14.5% |
| Pharmaceuticals and biotech | -3.8% | -68.8% to 14.6% |
Querychapters/14-peer-benchmarks/pipeline/20_model.sqlShow SQL
SELECT fy, industry, count(*) AS companies,
quantile_cont(op_margin, 0.25) AS p25, median(op_margin) AS median,
quantile_cont(op_margin, 0.75) AS p75,
sum(operating_income) / sum(revenue) AS pooled
FROM bench GROUP BY fy, industry;18 industriesRuns at build time in DuckDB 2.0; shown for reading.Open file
In semiconductors and software the industry's pooled margin is more than ten times the median company's
| Utilities | 121 | 13.0% | 20.2% | 26.1% | 20.7% | 7% | CHENIERE ENERGY INC | 5% |
| Other manufacturing | 383 | 0.3% | 7.3% | 14.1% | 8.1% | 23% | CATERPILLAR INC | 7% |
| Food, beverages, tobacco | 58 | 2.1% | 7.1% | 12.3% | 12.3% | 22% | PHILIP MORRIS INTERNATIONAL INC. | 21% |
| Other services | 244 | -0.2% | 7.1% | 15.8% | 15.9% | 27% | VISA INC. | 15% |
| Oil and gas | 80 | 1.5% | 6.8% | 21.0% | 7.6% | 21% | MARATHON PETROLEUM CORP | 18% |
| Construction | 38 | 1.2% | 6.7% | 10.1% | 7.4% | 24% | TOLL BROTHERS, INC. | 14% |
| Transportation | 70 | 2.1% | 6.0% | 15.7% | 10.9% | 16% | UNION PACIFIC CORP | 10% |
| Retail and restaurants | 166 | -0.4% | 4.0% | 8.4% | 6.4% | 26% | AMAZON COM INC | 33% |
| Chemicals | 65 | -7.1% | 3.5% | 13.5% | 10.7% | 38% | PROCTER & GAMBLE CO | 51% |
| Mining | 28 | -3.4% | 3.5% | 18.3% | 16.9% | 39% | SOUTHERN COPPER CORP/ | 42% |
| Wholesale | 69 | 1.3% | 3.5% | 7.3% | 2.2% | 16% | MCKESSON CORP | 16% |
| Computers and electronics | 127 | -3.4% | 3.1% | 11.6% | 18.4% | 32% | APPLE INC | 65% |
A peer table
The table an analyst would start from for one company is the same query filtered to its industry. For the 60 semiconductor companies, percent_rank() over operating margin places each one: Intel, with a margin of -4.2%, ranks at the 34th percentile of its group, and Texas Instruments, at 34.1%, at the 95th.
Among 60 semiconductor companies, Intel's operating margin ranks at the 34th percentile
| NVIDIA | 215.9 | 60.4% | 55.6% | 8.6% | — | 100% |
| BROADCOM | 63.9 | 39.9% | — | 17.2% | 42.1% | 98% |
| INTEL | 52.9 | -4.2% | -0.5% | 26.1% | -9.4% | 34% |
| MICRON TECHNOLOGY | 37.4 | 26.1% | 22.8% | 10.2% | 4.5% | 86% |
| ADVANCED MICRO DEVICES | 34.6 | 10.7% | 12.5% | 23.4% | 19.4% | 63% |
| APPLIED MATERIALS | 28.4 | 29.2% | 24.7% | 12.6% | 20.1% | 90% |
| TEXAS INSTRUMENTS | 17.7 | 34.1% | 28.3% | 11.8% | 14.7% | 95% |
| NXP SEMICONDUCTORS | 12.3 | 24.8% | 16.5% | 19.2% | 19.7% | 83% |
| ANALOG DEVICES | 11.0 | 26.6% | 20.6% | 16.0% | 38.8% | 88% |
| MARVELL TECHNOLOGY | 8.2 | 16.1% | 32.6% | 25.3% | 17.0% | 75% |
| AMKOR TECHNOLOGY | 6.7 | 7.0% | 5.6% | 2.5% | 2.8% | 58% |
| ON SEMICONDUCTOR | 6.0 | 1.4% | 2.0% | — | 23.7% | 44% |
Last year's numbers, reported again
Each 10-K repeats the prior year's figures as comparatives, so every company-year appears twice: in its own report and in the next one. Matching the two on company, line item and date measures how often a figure changes between them. Of the 4,958 companies with both reports, 678 reported at least one of the eight line items for fiscal 2024 differently in their fiscal 2025 report, and 508 changed one by more than 1%. The year before was similar: 13.5% of companies changed a fiscal 2023 figure.
Operating income is the figure most often reported differently a year later: 8.5% of companies changed it
| Operating income | 8.5% |
|---|---|
| R&D expense | 6.8% |
| Revenue | 6.2% |
| Operating cash flow | 5.5% |
| Shareholders' equity | 4.7% |
| Net income | 4.5% |
| Total assets | 4.5% |
| Capital spending | 3.8% |
Querychapters/14-peer-benchmarks/pipeline/20_model.sqlShow SQL
SELECT o.fy, o.cik, o.item, o.value AS original, l.value AS later,
o.tag = l.tag AND o.value <> l.value AS changed
FROM item_values o
JOIN item_values l ON l.cik = o.cik AND l.item = o.item
AND l.ddate = o.ddate AND l.fy = o.fy + 1
WHERE o.ddate = o.period;3,684 operating-income pairsRuns at build time in DuckDB 2.0; shown for reading.Open file
Most of these changes are presentation, not error. Operating income changes almost twice as often as net income (8.5% against 4.5%), and 227 companies changed revenue or operating income while leaving net income as it was, which is what moving a cost between lines or a business out of continuing operations does. 118 of the companies with a change reported a discontinued operation for fiscal 2024 in the later report that the earlier one did not have. Telling a reclassification from a correction of an error takes the text of the filing, which these extracts do not hold.
For a benchmark the consequence is practical. A peer table built from each company's latest report and one built from each year's original report can disagree for roughly one company in seven, and a rank near a cutoff, such as the median in a pay comparison, can move with it. Stating which vintage the table uses settles that.
Benchmark any company yourself
The dashboard below runs the chapter's benchmark table in your browser. The pipeline writes two Parquet extracts (the company-year table with its ratios and peer ranks, and every line item as first filed and as filed a year later) to public storage, 1.4 MB in all, and DuckDB-Wasm reads them over HTTP range requests. Pick an industry, a year and a ratio; search the peer table for a company. Every panel shows its SQL. The Ask box at the bottom hands your question to an AI model that writes the SQL; the query runs here, on the same files, and the model only sees the small result. Its answers are live and unaudited, unlike the numbers above.
Live · runs in your browser
10-K benchmarks for 2,000 companies, fiscal 2023 to 2025
- Engine
- DuckDB 2.0.1 · Wasm
- Data read
- 0 B of 1.3 MB
The chapter's data sits in 2 Parquet files on public storage, 1.3 MB in all. Start the engine and DuckDB runs inside this page: each chart below is a SQL query that reads only the row groups and columns it needs over HTTP range requests.
companiesCompany-years: revenue, income, cash flow, margins, peer rankrevisionsEach figure as first filed and as filed a year later
Queries this chapter's published snapshot; the data does not update in real time. No account, nothing uploaded.
Reusing the workflow
DOWNLOAD=1 SEC_USER_AGENT="<name> <email>" bash chapters/14-peer-benchmarks/pipeline/run.shPeer benchmarking from XBRL is a long-to-wide problem. Read every quarter's zip with one glob, keep the consolidated standard-tag rows, map several tags to one line item with a priority list and arg_min, PIVOT to one row per company and year, and rank within groups with percent_rank(). Then join the table to itself one year on to see which figures moved before relying on any of them. Full pipeline: chapters/14-peer-benchmarks.