Market basket analysis from POS lines: finding what sells together
Somewhere in your sales history is the pair of products that appear together far more often than chance explains, the attachment the best cashiers know by instinct. Market basket analysis finds those pairs systematically from transaction lines: no surveys, no opinions, just counting what shared a basket. Done honestly, it informs layout, offers, and staff prompts. Done carelessly, it discovers that everything sells with your bestseller and calls that insight.
The three numbers, in plain terms
- Support, how often the pair appears: "in 4% of transactions." Low support means the pattern, however pretty, moves little money.
- Confidence, when A is in the basket, how often B is too: "of baskets with A, 30% also have B." This is the number a cashier prompt is built on.
- Lift, how much more likely B is with A than without: lift of 1 means independent; 2 means twice as likely. Lift is the correction that stops "everything goes with milk" from topping the chart, milk has high confidence with everything because it is in everything.
Running it on POS data
- Export or query transaction lines grouped by transaction: item, transaction id, store, date. Work at item level for staples; at category level where items are sparse (variants and short-lived lines give thin data at item level).
- Filter ruthlessly before counting: exclude staff transactions, returns (negative lines poison pairs), and your top one or two traffic items from the headline list, or report them separately as the known gravity wells they are.
- Rank pairs by lift with a support floor, say, at least a few hundred joint baskets in the period, so the chart is patterns, not coincidences.
- Sanity-check the top pairs against the floor: a high-lift pair of items stored at opposite ends of the shop is a layout finding; a pair already adjacent is a confirmation, useful differently.
Turning pairs into action
Each strong pair earns exactly one experiment: adjacency in layout or display, a mix-and-match offer pairing them, a cashier prompt ("with that, they'll want…"), or a bundle. Run one, measure the pair's joint rate against the before period, keep what works. Pairs that survive contact with a promotion are your real attachments; pairs that only exist in history are usually a third cause, a season, an event, a promotion, that the data alone cannot see.
Negative pairs are information too
The pairs that repel are as useful as the pairs that attract: categories that almost never share a basket define separate missions, and forcing them into shared promotions wastes both. A customer on a top-up mission and a customer on a project mission are different visits wearing the same store, layout, staffing, and offer design serve both better when the data shows them apart: the quick mission protected from the project mission's browsing clutter, the project mission given its advice and space. Check your strongest negative pairs before any store remodel; they are the floor plan's load-bearing walls, and more than one redesign has failed by optimising a store for a single blended customer the data never contained.
Time and place bend the pairs
Basket pairs are not universal constants; they have shifts. The breakfast pairing exists at 8 a.m. and not at 8 p.m.; the barbecue pairing exists on the first warm Saturday and in the two weeks before a holiday weekend. Before acting on a strong pair, split it by daypart and by store cluster: a pair that only holds in destination stores is a layout instruction for those stores, not a chain order. Equally, re-run the analysis after any range change that removes a gravity item, pairs reorganise around the new anchor faster than intuition expects. The discipline is to treat every pair as having a context line on the chart (where, when, since when) and to retire pairs whose context has ended, rather than letting last year's festival friendship set this year's adjacencies.
A pairing that changed a layout, told plainly
The canonical small win: analysis shows batteries attach to a specific toy category at three times the baseline rate, overwhelmingly in the final quarter. The response costs nothing but a hook strip, batteries at the toy shelf end, in the denominations the toys actually take, and the attachment rate rises further while the forgotten-battery returns and complaints fall. Note the shape of the win, because most basket wins share it: the pair was already strong, the intervention served the mission the customer was already on, and the measurement that proved it (attachment rate, returns of the parent category) was identified before the hook strip moved. Basket analysis fails when it is used to invent missions customers do not have; it succeeds, modestly and repeatedly, by removing small frictions from the missions they demonstrably do.
Success: a short list of pairs the store acts on and re-measures quarterly, with the analysis refreshed on a rolling period so last year's festival pairing does not haunt this year's layout.
, Dex Carter, Tech Writer