Returns
Return lines carry no reference to the sale they reverse, so the link is inferred; and 14% of revenue has no customer at all.
Matching returns to sales with no key to join on
17,974 lines reverse a sale, and none of them reference the sale being reversed. There is no foreign key and no credit-note number, so the link has to be inferred: for each returned line, take the same customer's most recent earlier purchase of the same product.
Each row carries its own outcome instead of being folded into a single accuracy figure, because the failures have different causes. "No prior purchase in window" usually means the extract starts in 2009 and the sale happened in 2008, so the data is simply absent. "Quantity exceeds purchase" means the rule matched the wrong sale. At 2.0% that second figure is the one to watch: it measures the inference going wrong, where the first measures the source being incomplete.
The timing distribution is a check on whether the matches are real, and it holds up: the median return comes back 10 days after purchase, and 1,573 come back the same day. Matches drawn from arbitrary earlier sales would spread evenly across the two-year window.
The customers who are not here
Lines with no customer id
…as a share of revenue
Every per-customer number in this section, including retention, RFM and average order value, covers only part of the business. £2,569,367 of revenue comes from orders with no customer id, and none of it can be attributed to anyone.
The two shares differ: anonymous rows are 22.5% of lines but 13.5% of revenue, because orders placed without signing in are smaller ones. Lines are the easier figure to reach for, and using that share in place of the revenue share overstates the gap by nine points.
