Skip to content
echogeco
Data plumbing · Extract and normalise

The join that doubled the invoices

Decide which join ships for Monday after a paid-to-date total came out at twice the ledger in front of the finance lead, and what to do with the invoices that carry no claim number.

casemediumExercise · 4 min · 31 of 64
On this page

A number on a demo slide was twice the number finance publishes, and the finance lead was in the room. The decision is what you do in the four days before the next demo.

The situation

The triage prompt carries a paid_to_date field so the model can see whether a claim already has repair invoices against it. The pilot joins the demo's 1,200 claims to their 1,460 repair-shop invoices in the payments ledger on policy_no, the key both tables carry. The join returns 2,870 rows, and the paid-to-date total comes out at about 1.97 times the ledger's own report. In the Thursday demo the sponsor's finance lead reads the total aloud and asks why it is double. Afterwards you check: invoices carry a claim_no in 96% of rows; the other 4%, about 60 invoices, were keyed in by hand with only the policy_no. 310 of the policies have two open claims, and between them they carry 1,410 of the 1,460 invoices. The next demo is Monday. The customer's definition of done has five lines (agreement on the 200-case set, p99, cost, coverage and a named owner), none of which mentions paid-to-date, and nobody has yet measured whether the field moves agreement at all.

The question

Which join do you ship for Monday, what do you do with the 4% of invoices that carry no claim number, and what do you say to the finance lead before then?

A strong answer · Rubric · Where answers go wrong

Write your answer first, then open