A reporting dashboard in eleven slices, and the true table that communicated badly
Eleven report slices from KPIs to supplier performance, where the last two — cross-report dimension filters and filter-aware export — are what make the other nine usable, because an export that silently returns the unfiltered set is a report that lies.
What was done
Eleven report slices were built in a day over data the system already held: KPIs, sales and finance, batch and lot performance with drill-down, warehouse throughput, user comparison, consumables, activity timeline, pallet analytics and supplier performance, then cross-report dimension filters and a filter-aware xlsx/PDF export. The last two are what make the other nine usable — a question is narrowed once, this supplier and this quarter, and carried through every slice and into the downloaded file. The defect worth recording was not a wrong number: supplier performance seeded its rows from the supplier table and then joined the filtered facts, so filtering to a period listed every supplier the business had ever used, most of them zeroes across the row. The fix drops rows with no matching devices whenever a filter is active, and leaves the full list intact when none is.
dimension filter: supplier, quarter, lot
|
v
+--------------------------------+
| nine report slices |
| kpis, sales, batches, pallets, |
| suppliers, users, activity ... |
+--------------------------------+
| |
v v
rows on screen === rows in the export
|
+-- all-zero suppliers dropped while a filter is onOne filter, nine slices, and an export that has to agree with the screen.
Status
Shipped, 25 July 2026.
Eleven slices in one day.
The problem
The system held everything needed to answer real commercial questions — what a lot cost against what it returned, which supplier delivers what was promised, how many devices a technician audits in a week — and none of them could be asked.
What was built
| Slice | What it answers |
|---|---|
| 1 | KPIs — the headline numbers |
| 2 | Sales and finance analytics |
| 3 | Batch and lot performance, with drill-down |
| 4 | Warehouse operations throughput |
| 5 | User performance comparison |
| 6 | Consumables analytics |
| 7 | Activity timeline |
| 8 | Pallet analytics |
| 9 | Supplier performance |
| 10 | Cross-report dimension filters |
| 11 | xlsx and PDF export, filter-aware |
Slices 10 and 11 are what make the other nine usable. A dimension filter that applies across every report means a question can be narrowed once — this supplier, this quarter — and carried through. Filter-aware export means what is downloaded is what is on screen; an export that silently returns the unfiltered set is a report that lies.
The defect worth recording
drop zero-asset suppliers when a dimension filter is active.
Filtering supplier performance to a period listed every supplier the business has ever used, most with zeroes across the row, because the query built its rows from the supplier table and then joined the filtered facts. The reader saw a page mostly full of suppliers who had done nothing in that period, and had to find the handful who had.
Not a wrong number — a true table that communicates badly, which is its own category of reporting bug.
Why it matters
These reports are the only place the business's own performance is visible. A supplier who consistently short-delivers, or a grading standard drifting between technicians, shows up here or nowhere.
What was deliberately not built
No scheduled or emailed reports. No forecasting: the system reports what happened and does not predict.
Open questions
The Reports pages were brought into the app's visual system in August as part of the redesign series, which also indexed the sections so a reader can find the one they want.
The code
Supplier performance: the seeded rows are aggregated first, then dropped if a filter is active and nothing matched.
return [...bySupplier.entries()]
.map(([label, a]) => ({
label,
batches: a.batches.size,
assets: a.assets,
avgGrade: a.graded > 0 ? gradeLetter(a.points / a.graded) : null,
unitsSold: a.unitsSold,
revenue: round2(a.revenue),
profit: round2(a.revenue - a.cost),
returnRate: a.sold > 0 ? round2((a.returned / a.sold) * 100) : null,
}))
// When a dimension filter is active, only show suppliers that still have
// matching devices (the seed loop otherwise lists every supplier at zero).
.filter((row) => !hasAnyFilter(filters) || row.assets > 0)
.sort((x, y) => y.assets - x.assets || y.revenue - x.revenue);apps/api/src/reports/reports.service.ts — an excerpt, trimmed to the technique it illustrates.
Not shown. No cost-allocation or margin formula, no supplier names, no revenue figures. The manager-scoping rules that decide which lots a given reader's reports cover were left out as an access control still in use.
A published copy. Commit references and internal identifiers have been removed and the operator is not named; the engineering, the counts and the stated limits are unchanged.