The demand model · Part 3

Designing and Building a Demand Model

A demand model is a design, not just a calculation. You decide how shoppers divide the category and what they choose by. Spanner works out the numbers from the substitution data and tells you how well your design fits. This guide takes you through it in order, from the evidence to a saved model.

The steps

The order matters. Insight comes first: understand how shoppers choose, and get the coding right. The maths comes second, and it is quick once the design is sound.

Ask Spanner AI. It can do every step with you, and it checks each decision with you before it changes anything:
  • "Help me build a demand model for this category from the substitution data. Start by telling me how well the data covers my products."
  • "Compare the groupings with my classifications and tell me what the coding misses."
  • "Preview a model with one segment and with fruit as its own segment, and tell me which fits better."
This guide is for Spanner 2.5.1 and later. It assumes you have read Part 1 and Part 2, and that the document holds your products, their sales data and a substitution data set.
  1. InputSubstitution dataAnd your products
  2. Steps 1 and 2EvidenceCoverage, groupings, coding
  3. Steps 3 and 4DesignAttributes and segments
  4. Steps 5 and 6Build and checkRead the report, compare
  5. Step 7Demand modelIn the document and settings
  6. ThenUse itPart 4
Step 1

Start from the evidence

Before designing anything, find out how much the substitution data can tell you.

  1. How many of your products have data? Open Edit › Manage Substitution Data and look at the summary. It is normal for some to have none.
  2. How much of the demand goes to products that aren't in your document? A report covers the retailer's range, not yours. Demand that transferred to a product you don't have can't be traced further.
  3. Where does the category divide? Run Group from Top and read the top level, as described in Part 2.

Don't hold the work up to chase a perfect match between the report and your products. A planogram and a substitution report are rarely in step. What you need to know is how much evidence there is, so you can say how much weight the model will bear.

As a guide: with data for half the products or more, covering most of the sales, the model is on firm ground. With much less, treat it as a sensible structure that you have judged, rather than something the data has proved.
Step 2

Check your coding against the data

The model compares products by their classifications. If the classifications don't describe how shoppers choose, the model can't either. So set the groupings beside your coding, and look for four things.

What you findFor exampleWhat to do
A classification that is too fineBrand has 90 values, most with one or two products, because it holds every variant.Band it: variants into brand families, sizes into small, medium and large.
A classification that mixes two ideas"Segment" holds both the flavour and the price tier: Standard Apple, Premium Apple, Premium Fruit.Split it into one classification for each idea.
A divide no classification explainsThe tree shows a strong divide marked "?". One side is multipacks of cans, the other single bottles.Add the classification that describes it: here, a pack format.
Products in the wrong place, and errorsA product sits with a group its coding doesn't suggest, or a four-pack is coded as a single.Decide the boundary cases yourself. Correct the errors.

Two things in the manager make this quick. On the tree, each division names the classification that matches it best, or shows a "?". And the first level of Group from Bottom shows the tightest substitutes: what the products in each small group have in common is what shoppers don't mind swapping.

This step is often the most valuable part of the whole exercise. A classification that turns out not to match how shoppers buy is worth knowing about, whether or not you go on to build a model.
Step 3

Design the attributes

Attributes are the three or four classifications a segment's products are compared by. A good attribute has three qualities:

  • It is one idea. Flavour, or price tier, or pack format, or brand family. Not two at once.
  • It has a handful of values, about three to twelve, each with several products that have substitution data. Spanner learns a strength for every pair of values, and it can't learn from a value with one product.
  • It covers the document. Nearly all your products should have a value that the data has seen, so that products with no data of their own can still be placed. The build report gives this share, and Spanner won't choose an attribute by itself if the share is under 80%.

Attributes that work in many categories: type or flavour, price tier, pack format, and brand family with the small brands gathered into "Other brands".

Make them as calculated classifications

A calculated classification works its value out from a formula, for every product, and again whenever anything changes. So new products are coded as they arrive, and the model keeps working. To make one, add the classification in the Document Editor (Edit › Edit Document) and type its formula in the Calculation box.

A formula is a list of values, each with the rule for it, tried in order. The last part, else, catches everything the rules above it miss.

AttributeFormula
Brand Family
from a detailed Brand
"Brand A" if Brand starts with "Brand A"; "Brand B" if Brand starts with "Brand B"; "Own label" if Manufacturer = "Own Label"; else "Other brands"
Format
from pack type and number in pack
"Large can pack" if [Pack Type] = "Can" and [No. in Pack] in ("10 Pack", "18 Pack", "20 Pack"); "Small can pack" if [Pack Type] = "Can" and [No. in Pack] <> "Single"; "Single can" if [Pack Type] = "Can"; "Bottle pack" if [No. in Pack] <> "Single"; else "Single bottle"
Tier
from a mixed Segment
"Standard" if Segment starts with "Standard"; "Premium" if Segment starts with "Premium"; else "Super premium"

Rules can test a classification or a product property with =, <>, in (...), starts with, ends with and contains, compare numbers with < and >, and be joined with and, or and not. Put a heading in square brackets when it contains words such as in, or punctuation.

Check the counts. After adding a calculated classification, look at how many products have each value. A value with one or two products needs joining to another. A large "Other" suggests a family is missing from the formula.
Step 4

Segments or attributes?

A divide in the category can be handled in two ways. As a segment, the two sides are modelled separately and almost nothing moves between them. As an attribute, the divide is one of the things products are compared by inside a single segment, and Spanner learns how much does move across it.

Start from two lists of candidates: the top groups of Group from Top, and the segments you would expect from knowing the category. They usually agree. Segments matter because shoppers choose differently inside each one. Brand may count for a lot among mainstream products and hardly at all among craft ones, and a single segment averages that away.

Test a candidate by building the model with it and reading the report:

  • Hardly any demand should cross a segment's edge. The report says how much of each segment's demand moves to other segments. A few per cent is a segment. A fifth or more is not: join it to the segment it leaks to.
  • The checks should improve. The model's figures should come closer to the data's than with fewer segments. Step 6 explains the checks.
  • Look at the products on the edge. Edge products in the grouping often belong with the next segment. Widen the rule to take them: premium single bottles into a craft segment, for example.

A small segment is still a segment. What its size limits is how much it can learn. With fewer than about thirty products with data, give it fewer attributes, and expect some values to have no strengths of their own. Carry a divide as an attribute, not a segment, when demand does cross it.

There is one more case. Some products plainly don't substitute with the rest, but the data says nothing about them: alcohol-free products in a beer category, for example. Give them a segment of their own. That is a judgement, not a finding, and worth recording as one.

A product belongs to the first segment whose rule it meets. A segment with no rule takes every product that is left, so put it last and nothing falls through.
Step 5

Build the model

Choose Edit › Manage Demand Model. The menu offers what applies to the document:

Build from data set SubstitutesOpens the editor on a new model and builds it straight away from that data set.
Edit Demand ModelOpens the editor on the document's model.
Use Demand ModelGives the document a model you saved in settings.
Remove Demand ModelTakes the model off the document.

You can also start from a grouping: Create Demand Model, on the Substitution Data manager's last tab, opens the same editor with a segment for each top group. See Part 2.

The Demand Model editor

The Demand Model editor: name and measures across the top, the segments on the left, the selected segment's attributes and strengths in the middle, and the build report on the right
The editor, on a model started from a grouping. Segments are on the left, the selected segment's attributes and strengths in the middle, and the report on the right. This report's second sentence is the one to act on: 44 products are in no segment, so the design needs a last segment with no rule.
Name, measures and timeThe model's name. The codes of the rate of sale measure the model works on, usually value rate of sale, the distribution measure, and the demand measure that predicted sales are shown as. The time period of the sales data. The substitution data set, under Substitutes.
SegmentsEach segment's name and rule, with the number of products it holds. A rule Spanner can't read turns orange. Add, remove and reorder segments with the buttons beneath.
The selected segmentIts default lost share and cover curve (0 for none; the smaller the setting, the stronger the curve: see The cover curve), its attributes with their weights, and each attribute's strengths.
StrengthsA grid for the selected attribute: how readily shoppers of the value on the left move to the value above. Type a strength from 0 to 1 into any cell. A pair not shown takes is the strength for values the grid doesn't hold. Add value puts one of the segment's values, or all of them, into the grid at that strength, ready to type over. The cross beside a value takes it out again.
Lost share scale, Give-up scaleTwo judgements for the whole model, both 1 unless you change them. See Two settings that are your judgement.
Choose for mePicks the selected segment's attributes from the classifications that explain the data best, and builds the model. It is shown only when the document has substitution data.
BuildWorks out the strengths, lost shares and curves from the substitution data, and writes the report. With Work out weights ticked it also works out each attribute's weight. Untick it to keep the weights you have typed.
Save to Settings, OK, CancelOK puts the model on the document. Save to Settings also keeps it for other documents. Cancel changes nothing.

Building, step by step

  1. Set the measures and the time period. Choose a rate of sale measure that holds figures for the planogram's outlet and channel, and prefer the longer period. The distribution measure is optional: with one, a product that is hardly distributed is given the rate of sale of products like it.
  2. Enter the segments you chose in step 4, each with its rule, ending with one that has no rule. If you are not yet sure of them, start with a single segment and no rule, and add the others one at a time to see what each does to the report.
  3. Give each segment its attributes, from step 3. Or click Choose for me and see what Spanner picks.
  4. Click Build and read the report.
  5. Change the design and build again. Nothing is applied to the document until you click OK, so try alternatives freely.
  6. Click OK, then look at the shelf. View › Highlight › Demand Segment colours the planogram by segment, and its key counts each segment's products. It is a quick check that the rules place the products where you meant, and that none is left in no segment. See Substitutions and demand segments.
Choose for me picks whatever fits the data best. That is sometimes a classification that mixes two ideas, when the two cleaner ones would do nearly as well and be easier to explain. Use it as a suggestion, and give the attributes yourself when you know what shoppers choose by.

Changing the numbers by hand

Everything a build works out can be typed over: each segment's default lost share and cover curve, each attribute's weight, and every strength in the grid. Use this where you know something the data doesn't, such as a value the data never saw.

  • A build works the numbers out again. Type your changes after the last build. To keep the weights through a build, untick Work out weights. Typed strengths, lost shares and curves are replaced by the next build.
  • A document with no substitution data can still have a model. Enter the segments and attributes, use Add value to fill each grid, and type the strengths you judge to be right. There is nothing to build from, so Choose for me is not shown.
Ask Spanner AI. It can type these numbers with you, and set up a model by hand for a document with no substitution data. It should show you the figures it proposes, with its reasons, before it applies them. Treat them as judgement, not evidence.
  • "The model has no strengths for this brand family in the fruit segment. Suggest some and explain why."
  • "This document has no substitution data. Help me set up a demand model by hand, starting with the segments."

Two settings that are your judgement

Substitution data is collected from full ranges, one product missing at a time. Two settings let you say where you believe real shoppers differ from it. Both are 1 unless you change them, a build never sets or uses them, and they stay through a rebuild.

Lost share scaleThe far end of the range. It scales every product's lost share: at 0.7, each is 70% of what the data says. Less is lost from a full range, so the last products add less. Use it if you believe the data overstates what is lost, as when a range has been cut with little change in total sales.
Give-up scaleThe start of the range. It scales, in every segment, the share of shoppers who give up when their substitute is missing: at 0.5, half as many do. Cover rises faster, so a small range keeps more, and further products like those already ranged add less. Use it if you believe small ranges need more balance than the data shows.

The two work on opposite ends and don't interfere: the lost share scale leaves the start alone, and the give-up scale leaves a full range alone. They are judgements, not evidence, so note what you set and why. The sums are in Part 1.

Step 6

Read the report

Each build writes a report, segment by segment. It tells you whether the design fits the evidence. The figures below are made up, to show how the lines read.

Where the demand goes

Segment 'Cider': 120 products, 70 with data. Of their demand 24% is lost, 62% moves inside the segment, 2% to other segments, 12% to products that are not in the document or have no data.
  • To other segments should be small. If it isn't, the segments cut across how shoppers choose: go back to step 4.
  • To products not in the document is the demand the data can't trace further. The model treats it as willing to move to products like those it went to. The larger it is, the more the model is carrying.

What the attributes explain

Attributes: Flavour (3 values, makes the data's substitutes 75% more likely, the data has the value of 100% of the segment's products); Format (6 values, makes the data's substitutes 25% more likely, ...). Together 3.8 times as likely as size alone.
  • More likely is how much better the model predicts where demand really went, once the attribute is added. A large figure means shoppers really do choose by it.
  • Together ... times as likely as size alone sums the design up. Close to 1 means the attributes explain little, and the model is nearly a simple share of sales. Use it to compare designs that have the same segments.
  • The data has the value of ...% is the attribute's cover of the document. Low cover means many products will be placed by guesswork.

What was left out, and why

"... values, ... with one product: band it"Too fine to learn from. Band it with a calculated classification.
"the data has the value of only ...%: band it"Too many products have values the data has never seen. Band it so they fall into values it has.
"adds too little", "adds less than the ones used"It was tried and wasn't needed. Nothing to do.
"one value in this segment"It can't tell the segment's products apart.
"No classification explains where this segment's demand moves"The segment needs different coding, or joining to another.

The cover curve

Cover curve setting 0.75: fitted to the segment's 31 products with data, between which 70% of the demand that moves from them stays, followed through all cycles. The model is then within 1.3 points of the data for its best 1, 2, 3 ... sellers; 3.1 with no curve.

A build creates each segment's cover curve from the data. It takes the segment's best seller, then its best two, its best three and so on, and keeps the setting whose predictions are closest to what the data shows those ranges serve. Part 1 explains how the data is followed through all cycles.

  • It needs enough data. A segment gets its own curve when it has at least 8 products with data, and at least 60% of the demand that moves from them stays among them. Below that there is too little to follow.
  • A segment with too little takes the curve fitted across all the model's products with data. If that can't be fitted either, it has no curve. The report says which.
  • The two figures at the end show what the curve is worth: how far the model is from the data with it, and with no curve.

The checks

Check, every second product out: the data has 53% of the demand taken out picked up; the model 53%.

Spanner tests the model on three ranges it didn't use to set the curve: the smallest quarter of products taken out, every second product taken out, and the largest half taken out. For each it compares what the data says is picked up with what the model says.

  • The two figures compare directly. Both are worked out among the products with data, and demand that leaves those products counts as lost on both sides.
  • Every second product out is the closest to a real range change. Within a few points is good.
  • A wide gap is a real weakness. Say so when you present the model, and look again at the attributes.

Comparing designs

Build each design and compare three things: how much the attributes explain, the check on every second product, and how much of the document the attributes cover. Prefer the design that covers the document with attributes a category manager would recognise over one that scores slightly higher. A model people understand gets used.

After the segments, the report lists products in no segment, values the model has no strengths for, and products without a lost share of their own. A few of each is normal. Many of them mean the design doesn't yet cover the document.
Step 7

Save and reuse

In the documentClick OK in the editor. The model is saved with the document, and Edit › Undo takes it off again.
In settingsClick Save to Settings. The model is then offered under Edit › Manage Demand Model › Use Demand Model in any document.
For new documentsIn Tools › Settings, under Demand Models, mark one model as the default. New documents start with it. You can also reorder, copy and delete saved models there.
For colleaguesSaved models are included when you export a settings file with Demand Models ticked.

A saved model takes its calculated classifications with it. When you use it in a document that doesn't have them, Spanner adds them with their formulas. Check their values afterwards: a formula tests that document's coding, which may differ from the document the model was built in.

A model built for one retailer's shoppers is a reasonable starting point for another's, but it is evidence about the first. Where you have substitution data for both, build both and compare them.

Keeping it up to date

A model goes out of date in three ways, and the editor's report shows each:

  • New products that no segment's rule covers. They keep their own rate of sale and nothing moves to or from them. Widen a rule, or end with a segment that has none.
  • New values the model has not seen, such as a new brand. The model uses the attribute's typical strength for them. Calculated classifications with an else value prevent most of this.
  • New substitution data. Import it, open the editor and click Build. The segments and attributes are kept, and the numbers are worked out again.

Next: Part 4, Using the Demand Model for Ranging.

Want help with a demand model?

A demand model for your category is worth setting up carefully. We can build one with you, from your substitution data and your knowledge of the category.

Email us Book a Demo