I built a SQL script that checked every relationship in a supply-chain model for an expired disclosure, all at once. In 2024 it saved an estimated 360–480 hours, and it became a core reference for rebuilding the workflow tool.
241
Reports in 2024up 15% on 2023
360–480
Hours saved in 2024estimate, from the survey’s 30–40%
95%
Recommended actions accepted
Role
Sole builder: the query, the four-year rule QC, the recommendation algorithm and the pipeline
Team
Built solo, from earlier attempts I studied with the team’s senior analysts. Used across the team, especially on large models
Timeline
Built in Q1 2022 and live from Q2 2022. Large-model features in Q3 2022, and the cloud pipeline in Q2 2023. In use until 2025
Stack
SQL on the team’s database; Python; Bloomberg’s internal cloud; Terminal APIs
Before
Each analyst on the team covered about a hundred companies, with a supply-chain model for each: the company’s customers and suppliers, and for the quantified ones, their share of its revenue or costs. A relationship counts only while its disclosure is under four years old, and a model with an expired relationship can’t be published.
So before publishing, an analyst opened the legacy workflow tool and clicked through every relationship, one at a time, reading each disclosure date. A large model has one or two hundred. The market data came alongside, gathered by hand or pulled through a spreadsheet API with a notebook running next to the tool. The team had talked about it for a decade, and several analysts had tried to fix it.
open the work itemone tick, one relationship · 100–200 in a large model · three clicks eachpublish
one relationship, in the legacy workflow toolclick 1open the relationshipclick 2open its source listreadfind the most recent source — its date decides whether the relationship still countsclick 3back to the workflow screenlook upits market data — by hand, or a spreadsheet API with a notebook open beside the toolnext relationship
~450 clicks to reach 150 dates× 100 companies an analyst× twice a year, required× 20 analysts
Representative diagram. The steps are the real ones; three clicks per relationship, 100–200 relationships in a large model.
Why it mattered
Two clocks run at once: the four-year rule on every relationship, and a 14-month rule on every model. A model not refreshed within 14 months loses its quantified relationships from the Terminal, so once a year is the floor.
The team required a refresh twice a year and aimed for quarterly. At twice a year, models alone would take about half of each analyst’s working year; at quarterly, all of it. So some analysts fell back to once a year, the last safe point. By their own estimate, about half a large model’s time went to work that waited on outside data vendors, such as renewing disclosure documents before publishing.
The moves
The bet was to move the check off the screen and into one query, then get each answer to the analyst who needed it. I built it alone, starting from the earlier attempts: I worked through their scripts, spreadsheets and API calls with the senior analysts, and taught myself the legacy tool’s database schema.
01
Ask the database, not the screen.
The workflow tool showed one relationship per click. Its database held all of them. Once I knew the schema, one query could return every relationship of a company, quantified or not, joined to its latest disclosure. One Bloomberg identifier (BBID) in, one report out.
The engineering
Representative
SELECT e.name, e.bbid,
r.side, r.reported_by,
d.doc_url, d.disclosed_on,
q.rel_id IS NOT NULL
AS quantified
FROM relationships r
JOIN entities e
ON e.bbid = r.counterparty
LEFT JOIN disclosures d
ON d.rel_id = r.id
AND d.disclosed_on = latest(r.id)
LEFT JOIN quantified q
ON q.rel_id = r.id
WHERE r.company = :bbid
-- one BBID in
02
Put the four-year rule in the query.
Each row gets a status and a countdown in months. The status is current, approaching (six months or fewer left) or expired. In Q2 2022 I checked the flags against a direct query of every relationship’s expiry date. Every one was right, with no false positives.
The engineering
Representative
expires_on = disclosed_on + 4 years
months_left = months_between(
expires_on, today)
status = CASE
WHEN months_left < 0
THEN 'EXPIRED'
WHEN months_left <= 6
THEN 'APPROACHING'
ELSE 'CURRENT'
END
disclosed · current for 42 monthsapproaching · 6 → expired
03
Say what to do, and why.
A flag says something’s wrong. The report says what to do about it, with the reasoning on the row: maintain, add or remove a relationship, re-slice it into the product line it fits better, or renew its disclosure. Market data from the Terminal APIs sits on every row and feeds its decision: the counterparty’s industry classification (BICS), market status and adjusted market cap. From Q3 2022, large models could be grouped by industry and filtered by market cap. Analysts accepted about 95% of the recommendations.
The engineering
Representative
condition
→ ACTION · reason on the row
in filing ∧ not in model
→ ADD · {doc} discloses a new pair
bics(counterparty) ≠ slice
→ RE-SLICE · fits {slice} better
expired ∧ newer filing names pair
→ RENEW · {doc} re-discloses it
expired ∧ nothing newer
→ REMOVE · no disclosure
under 4 years
approaching ∧ quantified
→ RENEW · newer filing
resets the clock
current
→ MAINTAIN · holds until
{expires_on}
04
Work inside the access limits.
Only select analysts could reach the team’s database, so for everyone else the screener ran on request: a BBID in a message to me, a report back. From Q2 2023 a Python pipeline left the reports in Bloomberg’s internal cloud for analysts to collect. No interface was ever built. The report was the product.
The engineering
Representative
analyst ─► BBID, in a message ─► me
│
query team’s database │
rule status · months_left │
enrich Terminal API: │
BICS, mkt status, │
adj cap │
decide action · reason │
▼
report ─► internal cloud
─► analyst collects
from Q2 2023: a Python wrapper runs
the four steps and drops the file
After
The report as an analyst received it, for one company: a spreadsheet with every relationship, its status under the four-year rule, and what to do about it.
5Harlow Metals48213SupplierHarlow MetalsFeb 202110-KFeb 2025Approaching4Renew the disclosureQuantified; find a newer filing to reset the clockSteelActive4.2B
6Marrow Chemicals55732SupplierMarrow ChemicalsJan 202210-KJan 2026Current15Re-sliceA coatings supplier sitting in the powertrain sliceChemicalsActive6.7B
7Ostrava Glass47731SupplierOstrava GlassAug 2022Annual reportAug 2026Current22MaintainDisclosure holds until Aug 2026Building productsActive1.1B
9← counterparty 4116641166CUSTOMER · 41166411662024-09-30 latest2024-09-30 +4yelse → CURRENT47→ ADDin filing ∧ not in modelbics(41166) = AUTOSACTV2.3e9
Drag the divider, or focus it and use the arrow keys. The outlined parts open the engineering behind them.
Status and countdown
Expiry is the disclosure date plus four years. The report counts down to it in months and names the status: current, approaching when six months or fewer remain, expired past zero. In Q2 2022 I checked every flag against a direct query of the database; all of them were right.
The checks run in order, the two that ignore status first, and the first that fits sets a row’s action; the row says why. Approaching and quantified: renew the disclosure. Expired with nothing newer: remove. In a filing but not in the model: add. The wrong industry for its slice: re-slice. Analysts accepted about 95% of them.
BICS industry, market status and adjusted market cap come from the Terminal APIs on every row. Analysts used to gather that data by hand from several sources, or through a spreadsheet API with a notebook alongside. From Q3 2022 a large model could be grouped by industry and filtered by market cap.
t.bics(bbid) · t.mkt_status(bbid) · t.adj_cap(bbid) -- Terminal API, one call per counterparty
Representative data. Company names are invented; the columns, the rule and the actions are the real ones. The status shading is the page’s, not the file’s.
How I measured it
Years in, it was still an interim tool, so I measured it to make the case for it.
First, timestamps. The same companies and analysts come round again and again, so I timed models made before the screener against the ones after, from the moment a work item was opened to the moment it was published. The results supported the idea but couldn’t prove it: the system was never built to measure analysts, and the timestamps include idle time.
The timestamp comparisonOne company · one analyst
model buildwork item openedpublished2021 beforescreener in use2022 after20232024 inferred2025 unknown
Representative. The method is real; the bars are not measurements. Timestamps include idle time, so this supports the result without proving it.
Then a survey. I asked the analysts who used it most about each of a model’s main tasks: updating, adding and removing relationships, re-slicing a company into its product lines, and reassigning its customers and suppliers to them. Across those tasks, it shaved 30–40% off a model’s time. The next two sections are built on that number.
30–40%
Of a model’s time savedfrom the survey
What happened
Most of the team used it on their large models. Requests kept climbing year on year, and I ran every one of them for the analysts who had no database access. By the survey’s numbers, the time it freed was enough for 72–96 more models at the old pace.
241
Reports in 2024up 15% on 2023
360–480
Hours saved in 2024estimate, from the survey’s 30–40%
95%
Recommended actions accepted
At full use
Only the models analysts asked about got screened. Run it on every model, twice a year as the rules require, and the arithmetic says it hands the team back the equivalent of three or four full-time analysts a year. A forecast, kept apart from what happened.
Twice a year · the requirement
20 analysts× 100 companies each× 2 models a year× 5 hours a model× 30–40% of it saved
6,000–8,000
Hours a yearforecast
Once a year · the floor
20 analysts× 100 companies each× 1 model a year× 5 hours a model× 30–40% of it saved
3,000–4,000
Hours a yearforecast
5 hours a model: a quarter are large and take 8, the rest 4. 30–40%: the survey of the analysts who used it.
What it led to
Its query, API calls and enrichment became a core reference for rebuilding the workflow tool: the backend process, and the data fields the new interface needed.
In 2024, management saw its flags as groundwork for prioritizing the queue of the LLM pipeline. Pairs that were new, approaching expiry, or expired but quantified would go first.
What I’d carry forward
An interim tool deserves real engineering. This one became a core reference for its replacement.
Start from the people who tried before. Their scripts and spreadsheets were most of the way there.
When people can’t reach the data, deliver the answer to them. No interface was ever built; the report was enough.