Demand Forecasting
Predicting What Customers Will Buy Next
The Cost of Guessing Wrong
Every retailer in India knows this pain. You ordered 200 kg of sugar before Diwali because "last year it sold well." But this year, customers bought more dry fruits and less sugar. Now you have 80 kg of sugar sitting on the shelf, tying up capital. Meanwhile, the dry fruits you stocked conservatively sold out by day two, and you turned away customers who went to the shop across the street.
This is the forecasting problem. Overstocking costs you money (spoilage, storage, tied-up capital). Understocking costs you sales and customer trust. The average Indian retailer loses 5-10% of revenue to poor demand estimation — and for perishable goods like dairy, fruits, and vegetables, the number can reach 20%.
AI does not eliminate uncertainty. But it reduces it dramatically by analyzing patterns in data that no human can process manually. This chapter teaches you how demand forecasting works, why it matters, and how to start using it — even if your "data system" is a notebook and a calculator.
Gut Feel vs. Data-Driven Forecasting
Most small and mid-size retailers in India forecast demand using one of three methods:
| Method | How It Works | Accuracy |
|---|---|---|
| Gut feel | "I think we will sell more this week" | 50-65% |
| Last year same period | "We sold 100 units in October last year, so order 100 again" | 60-70% |
| Moving average | Average of last 4 weeks of sales | 65-75% |
| AI forecasting | Analyzes sales history, seasonality, festivals, weather, trends | 80-92% |
The difference between 65% accuracy and 85% accuracy might not sound dramatic, but for a business doing Rs 10 lakh per month in sales, that gap represents Rs 1-2 lakh in either lost sales or wasted inventory. Over a year, that is Rs 12-24 lakh — enough to fund a second store.
How AI Demand Forecasting Works
AI forecasting is not magic. It follows a logical process that you can understand without any technical background:
Step 1: Collect Historical Data
The AI needs your past sales data — ideally 12-24 months. More data means better predictions. This includes: date of sale, product/SKU, quantity sold, price at the time, and any promotions running.
Step 2: Identify Patterns
The AI looks for three types of patterns:
Step 3: Generate Forecasts
Based on these patterns, the AI predicts demand for the next day, week, or month — with confidence intervals. Instead of saying "you will sell 100 units," it says "you will likely sell 85-115 units, with 90% confidence." This range is far more useful for ordering decisions.
Open data/sales-history.csv in the code panel. This file contains 12 months of daily sales data for a mid-size grocery store in Pune — 15 product categories, daily quantities, prices, and whether a promotion was active. This is the raw material AI works with.
Festival-Driven Demand: India's Unique Challenge
India's festival calendar creates demand spikes that would confuse any forecasting model not trained on Indian data. This is why generic global AI tools often fail for Indian retail.
The Festival Effect
| Festival | Typical Demand Spike | Key Categories |
|---|---|---|
| Diwali | 3-5x normal | Sweets, dry fruits, electronics, clothing, home decor, gifting |
| Holi | 2-3x normal | Colors, sweets, white clothing, water guns |
| Eid | 2-4x normal | Clothing, perfumes, dates, meat, sweets |
| Onam | 2-3x normal (Kerala) | Sarees, bananas, rice, flowers, gold |
| Pongal | 2-3x normal (Tamil Nadu) | Rice, sugarcane, turmeric, new cookware |
| Navratri | 2-3x normal (Gujarat/North) | Chaniya cholis, dandiya sticks, fruit, fasting foods |
| Wedding season | 2-4x sustained | Clothing, jewellery, catering supplies, electronics |
The challenge is not just the spike — it is the timing. Diwali falls on a different date every year (lunar calendar). Ramadan shifts by about 10 days annually. A good AI forecasting system accounts for these moving dates automatically.
Regional Variation
A forecasting model trained on Delhi data will fail in Chennai. Pongal matters in Tamil Nadu but not in Punjab. Bihu matters in Assam but not in Maharashtra. AI must be trained on local data to capture these regional patterns.
Open data/festival-calendar.json to see a structured dataset of Indian festivals by region, typical demand multipliers, and key product categories. This is the kind of reference data that makes AI forecasting India-aware.
Building Your First Forecast
You do not need expensive software to start. Here is a practical approach using AI chat tools:
The Simple Moving Average (Baseline)
Before using AI, understand the baseline. Take your last 4 weeks of sales for any product and calculate the average. That is your simple forecast.
Week 1: 45 units
Week 2: 52 units
Week 3: 38 units
Week 4: 55 units
Simple forecast for Week 5: (45 + 52 + 38 + 55) / 4 = 47.5 unitsThis works reasonably well for stable products. But it completely misses trends, festivals, and external factors.
The AI-Powered Forecast
Now paste those same 4 weeks (or ideally 12+ weeks) into Claude or ChatGPT with this prompt:
Here is my weekly sales data for [product] at my store in [city]:
[paste your data]
Predict next week's sales considering:
- Any upcoming festivals or events
- The trend in the data
- Day-of-week patterns if daily data is available
- Any anomalies in the historical data
Give me a point estimate and a range.The AI will identify patterns you might miss — like the fact that Week 3 was low because it had a public holiday, or that the upward trend suggests Week 5 should be closer to 58 than 47.
Working with Your Sales Data
What Data to Collect
If you are starting from scratch, begin tracking these fields daily:
| Field | Example | Why It Matters |
|---|---|---|
| Date | 15-Mar-2026 | Identifies day-of-week and seasonal patterns |
| Product/Category | Toor Dal 1kg | SKU-level forecasting |
| Quantity Sold | 23 units | The core metric |
| Selling Price | Rs 145 | Price changes affect demand |
| Promotion Active? | Yes/No | Separates organic vs. promotion-driven demand |
| Stock Available | 50 units | Identifies constrained days (sold out = data is unreliable) |
| Weather | Rainy/Hot/Normal | Affects footfall and category preferences |
Common Data Problems
Practical Exercise: Your 5-Step Forecast
Key Takeaways
This is chapter 2 of AI for Retail & E-Commerce.
Get the full hands-on course — free during early access. Build the complete system. Your projects become your portfolio.
View course details