Overview

This was a set of connected data projects for a supermarket specializing in imported candies and chocolates. The store faced two structural constraints: unpredictable, trend-driven demand for niche products, and long, inconsistent import lead times of two to six weeks. Every decision was reactive. Purchases were made on gut feel, products were stocked and displayed in isolation, and there was no structured view of what actually performed.

I built three workstreams on top of the same clean POS foundation: inventory intelligence to decide what to buy and how much, demand forecasting to look a couple of weeks ahead, and basket analysis to understand what customers buy together. The shared goal was decision support, not dashboards for their own sake. Across all three, I favored explainable logic over black-box models, actionable SKU-level outputs over aggregated insights, and adoption over sophistication. With sparse per-SKU data and a need for trust, rules and baseline methods delivered faster, more reliable returns than heavy ML would have.

The data layer was consistent throughout: daily POS transaction data and product metadata such as brand, category, and origin. BigQuery handled aggregation and SQL processing, Python held the decision and analysis logic, Pandas did the wrangling, and Looker Studio surfaced the outputs.

Inventory intelligence

The inventory problems were systemic rather than isolated. Popular imported brands went out of stock and cost revenue directly, low-demand products sat on shelves for months and locked working capital, and import delays were never factored into purchasing. There was also no distinction between fast- and slow-moving SKUs, or between seasonal and consistent demand.

I modeled demand using rolling averages over 7, 14, and 30 days, standard deviation as a volatility measure, and sales frequency counted as days with sales. On top of that I applied ABC classification by revenue contribution: A items (top ~70%) must always be in stock, B items (~20%) are moderate priority, and C items (~10%) are candidates for liquidation. This kept attention on high-impact SKUs and cut noise from the long tail.

Reorder decisions came from two formulas:

reorder_point = (avg_daily_sales * lead_time_days) + safety_stock
safety_stock = demand_std * sqrt(lead_time_days)

For each product, the output showed current stock against the reorder point, a recommended reorder quantity, its priority class, and a risk flag for stockout or overstock. The tradeoffs were deliberate: rule-based logic is easier to adopt but less adaptive, SKU-level modeling is precise but compute-heavy, and rolling averages are stable but slower to react. The result was reduced stockouts for high-priority products, identified dead inventory, more consistent restocking, and less reliance on intuition, which improved cash flow and revenue capture.

Demand forecasting

The driving question from the store was “how do we know what will sell next?” Reacting to the past does not work when imports arrive weeks late, so the aim was to be directionally correct rather than perfect. Forecasting was hard here for three reasons: demand was noisy, with some products selling daily, some weekly, and some spiking at random; data was sparse, so ML models would overfit; and there was no marketing or campaign context to lean on.

I kept the horizon short, focusing on the next 7 to 14 days, and used stable signals over noise. The core was a rolling average with a weighted variant:

forecast = rolling_mean(last_n_days)
forecast = (0.6 * last_7_days_avg) + (0.4 * last_30_days_avg)

For intermittent demand, I combined sales frequency with average sale size rather than treating sparse SKUs as continuous series. The tradeoffs were that baseline models are less reactive and, without external data, context is limited. In return the store gained better restocking decisions, fewer stockouts, and less over-ordering, and a foundation to build more predictive systems on later.

Basket analysis

The store carried hundreds of SKUs but treated each one independently, even though customers build baskets. With only transaction-level data and no user-level tracking, the system had to rely on patterns within transactions rather than within users. High product variety and sparse combinations meant long-tail pairings dominated, so I focused on practical, high-impact associations that were directly actionable.

Each transaction became a basket of SKUs, and I mined association rules over them using three metrics: support (how often a combination appears), confidence (probability of B given A), and lift (strength of association beyond chance). I filtered rules by a minimum support threshold, high confidence, and lift greater than 1, since high frequency alone is misleading and lift confirms a relationship is meaningful rather than driven by an item’s individual popularity. Rather than emit hundreds of rules, the system produced roughly 10 to 20 actionable insights: top cross-sell pairs, bundle suggestions, and placement recommendations. Threshold filtering can miss niche but valuable combos, and aggregate analysis misses individual preferences, but keeping the output small kept it usable. This identified strong product pairings, improved placement strategy, enabled bundling ideas, and increased average basket value.

What this enabled and what comes next

Together these three workstreams moved the store from reactive stocking to systematic, explainable decisions across purchasing, replenishment timing, and merchandising, all from one clean POS data layer. The natural next steps build on that foundation: supplier optimization and automated reorder alerts, multi-store inventory balancing, richer forecasting once more history and external signals are available, and turning basket insights into bundle pricing, combo campaigns, and, if the store moves online, recommendations.