Back to guides
2
7 min

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:

MethodHow It WorksAccuracy
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 averageAverage of last 4 weeks of sales65-75%
AI forecastingAnalyzes sales history, seasonality, festivals, weather, trends80-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:

  • Trend — Is the product selling more over time (growing) or less (declining)? Atta might be steady, but oat milk might be growing 10% month-over-month.
  • Seasonality — Does the product have predictable cycles? Umbrella sales spike in monsoon. Woollen clothing peaks in November-January. Sweets surge before every major festival.
  • External factors — Weather, local events, competitor actions, and economic conditions all affect demand. AI can incorporate these signals when the data is available.
  • 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

    FestivalTypical Demand SpikeKey Categories
    Diwali3-5x normalSweets, dry fruits, electronics, clothing, home decor, gifting
    Holi2-3x normalColors, sweets, white clothing, water guns
    Eid2-4x normalClothing, perfumes, dates, meat, sweets
    Onam2-3x normal (Kerala)Sarees, bananas, rice, flowers, gold
    Pongal2-3x normal (Tamil Nadu)Rice, sugarcane, turmeric, new cookware
    Navratri2-3x normal (Gujarat/North)Chaniya cholis, dandiya sticks, fruit, fasting foods
    Wedding season2-4x sustainedClothing, 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 units

    This 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:

    FieldExampleWhy It Matters
    Date15-Mar-2026Identifies day-of-week and seasonal patterns
    Product/CategoryToor Dal 1kgSKU-level forecasting
    Quantity Sold23 unitsThe core metric
    Selling PriceRs 145Price changes affect demand
    Promotion Active?Yes/NoSeparates organic vs. promotion-driven demand
    Stock Available50 unitsIdentifies constrained days (sold out = data is unreliable)
    WeatherRainy/Hot/NormalAffects footfall and category preferences

    Common Data Problems

  • Stockout days look like low-demand days. If you sold 0 units on Tuesday, was it because nobody wanted the product, or because you ran out on Monday night? AI needs to know the difference.
  • Promotion spikes distort baselines. A "buy 2 get 1 free" week is not a normal week. Tag promotions so AI can separate organic demand from promotion-driven demand.
  • New products have no history. For products less than 3 months old, AI uses "similar product" benchmarks instead of direct history. Tell the AI what existing product the new one is most like.
  • Practical Exercise: Your 5-Step Forecast

  • Export data — Pull your last 3 months of sales for your top 10 products. Even a handwritten ledger works — just type it into a spreadsheet or directly into AI chat.
  • Identify your next event — What is the next festival, sale, or local event? How did it affect sales last year?
  • Ask AI for a forecast — Use the prompt template above. Start with one product category.
  • Compare to your gut — Write down what you would have ordered without AI. Compare to the AI suggestion.
  • Track accuracy — After the week passes, check: Was AI closer to reality, or was your gut? Most people find AI wins within the first month.
  • Key Takeaways

  • Overstocking and understocking are both expensive. AI forecasting reduces both by finding patterns in your historical sales data that are invisible to manual analysis.
  • India's festival-driven retail requires India-trained models. Generic forecasting tools miss Diwali spikes, regional festivals, and the lunar calendar. Always use India-specific data and context.
  • Start with the data you have. Even 3 months of handwritten sales records are enough to begin. Accuracy improves as you collect more data and correct the AI's mistakes.
  • Moving average is your baseline, not your ceiling. If your forecasting method is "same as last week" or "same as last year," AI can improve your accuracy by 15-25 percentage points — and that translates directly to profit.
  • 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