03 · Challenges
Where this got difficult
Challenge 01
Three files that don't join
Sales, vendor and inventory extracts arrive separately with no shared grain, which is the
polite way of saying there is no column they agree on. Nothing could be answered until they
were reconciled. I could have joined them per question, but then every finding would rest on
its own ad-hoc join and two findings could quietly disagree. Building one vendor-level summary
table first was slower to start and made everything after it a single query.
Challenge 02
Margins of negative infinity
Some rows sold at or below cost, one as low as −$52,002.78. Worse, sales at zero cost produce
an undefined profit margin, so any average over that column is meaningless.
These are real transactions, not corrupt data, which made deleting them a judgement call
rather than a cleanup. I removed them and wrote the exclusion rules on the page, because a
margin analysis where the reader cannot see what was dropped is not worth much.
Challenge 03
The answer contradicted the brief
The assumption going in was that large vendors negotiate harder and therefore earn better
margins. The data said the opposite, by a wide gap. Reporting that off a bar chart would have
been irresponsible, so I ran a hypothesis test and it came back significant. The two groups
are running different strategies: scale vendors trade margin for volume, niche vendors do the
reverse. That changes what "a good vendor" means in a negotiation.