Retail Transactions
A UK gift wholesaler's complete transaction log: every line of every invoice over two years, uncleaned by anyone (UCI's Online Retail II). It is the only source here recording individual purchases rather than published statistics.
Order lines
Customer ids
Net revenue
Revenue with no customer
Trade peaks every autumn
The business sells Christmas stock to shops, so each autumn is its year. Getting to a revenue figure at all means settling what the one amount column holds: postage, bank fees, bad-debt adjustments and stock write-offs sit in it beside the goods. What counts as revenue →
Customers come back in autumn, whenever they were won
Read down a column and retention decays with age; read along a diagonal and every cohort lights up in the same autumn. A retention curve averages the two together, which is how a seasonal business talks itself into a loyalty problem every January. Retention →
A fifth of the customers bring three-quarters of the revenue
The top 20% of customers bring in 77% of the revenue, and the top 1% alone bring in 31% of it. A campaign that lifts the average but misses the top percentile has moved almost nothing. Who the customers are →
The first order predicts most of the rest
Customers who ordered once make up the diagonal: they are worth their first order, less anything they sent back, so the 12% who returned something sit just below it. Above it, customers whose first order was in the top fifth went on to be worth about ten times the bottom fifth. The first order →
Also on this data
- Returns and missing customers: 17,974 return lines matched to their sales with no key to join on, and the revenue no customer id can be attached to.
Sources. UCI Machine Learning Repository, Online Retail II
(Chen, D., 2019), CC BY 4.0. Exchange rates from the ECB via
Frankfurter. The transaction data is real and
unmodified; the modelling decisions are documented in
dbt/models/staging/stg_retail_lines.sql and the retail mart models built on it.
