Inspiration
A receipt records what someone bought, but the business questions start afterwards: What is gaining popularity? Which brands are losing repeat buyers? What gets purchased together? Where should a company investigate its next growth opportunity?
Inspired by P&G’s DurHack challenge, we built NeedState to turn fragmented purchase records into useful commercial evidence. We wanted to bridge the gap between a spreadsheet full of transactions and a decision about what to investigate, forecast or test next.
Although P&G inspired the challenge, the approach extends to other consumer goods companies through a configurable brand and portfolio lens.
What it does
NeedState transforms receipt spreadsheets and photos into an interactive workspace for understanding purchasing behaviour.
Its Opportunities workspace brings together category reach, changes in purchasing, business priorities and forecasts. Analysts can distinguish categories that are already popular from those gaining ground, then investigate the evidence behind a potential opportunity.
The Brands workspace adds brand comparisons, repeat purchasing and observed switching histories. Instead of treating every change as a business breakthrough, it helps identify which movements deserve closer attention.
Users can upload a spreadsheet or extract items from a receipt photo, review the results, and either add them to their existing collection or focus on the upload independently. Findings connect back to products, baskets and buyer histories, making it possible to inspect the evidence behind an insight.
Where sufficient history exists, NeedState also estimates portfolio inclusion on a shopper’s next observed category trip and compares its approach against a baseline using held-out data. This gives companies a starting point for future-facing research, while keeping the distinction between a purchasing forecast and a guaranteed financial return clear.
How we built it
We built a Python analysis engine with a custom HTML, CSS and JavaScript browser interface. Pandas and NumPy handle transaction processing, SciPy supports statistical analysis, and NetworkX supports relationships between products and baskets.
We incorporated our teammate’s receipt ingestion code to bring OCR into the same import workflow as spreadsheets. Both sources pass through validation and review before entering the analysis.
The engine resolves product descriptions into families, attaches available category and brand metadata, and examines patterns at different levels. We separated individual purchasing routines from basket-level associations so that a shopper’s consistent preferences would not automatically be mistaken for a meaningful product pairing.
The interface evolved around an analyst’s workflow: identify a movement, inspect the supporting evidence, then decide what deserves further investigation.
Challenges we ran into
One of our biggest challenges was discovering that the synthetic dataset contained limited evidence of genuine trends. We had to build an application that could produce useful observations without inventing growth stories.
Another was separating correlation from shopping behaviour. Products can appear together because the same people repeatedly buy them, rather than because they belong to a shared shopping mission. Consumer-adjusted comparisons helped us address that distinction.
Receipt extraction introduced further challenges: inconsistent layouts, quantities, abbreviated descriptions and imperfect images. We added a review step so extracted data could be checked before affecting the wider collection.
Performance also mattered. Repeated preparation of category and brand insights made imports frustratingly slow, so we investigated unnecessary work and improved processing efficiency while preserving the analytical logic.
Accomplishments that we're proud of
We brought receipt OCR, spreadsheet imports, category trends, brand movements and conditional forecasts into one connected workspace. We’re especially proud of making insights traceable to their supporting receipts, improving processing speed, and distinguishing meaningful signals from patterns the data cannot confidently support.
What we learned
We learned that a useful insight needs more than a chart. It needs a clear business question, an appropriate comparison and evidence that someone can inspect.
We also learned that popularity, growth, repeat purchasing and brand switching describe different things. Combining them into one score can hide the very behaviour a company needs to understand.
Most importantly, uncertainty is part of the result. Limited records, incomplete brand information and short observation periods should affect the strength of a conclusion.
What's next for NeedState
Our next steps are to validate NeedState against genuine purchasing data, improve product and brand coverage, and evaluate forecasts across more future periods.
We also want to connect promising opportunities to controlled business experiments. The longer-term goal is to help companies move from “something changed” to “here is the next decision worth testing.”