Building the calendar
Every Monday we build a markdown plan for every product up to the exit, and apply only this week's step. Set free, the calendar comes out level with a well-built rule. Knowing the true demand gains little too; the bottleneck is where the stock is.
Markdown Calendar · 5 / 6
In this article we ask: can we build each product’s markdown calendar week by week from a forecast, and will that calendar beat a good rule? We had two missing pieces. The coverage rule of the third article did not know how demand would melt away over the season. Nor did it know how much a markdown sells; we measured that in the last article. In this article we bring the two together and turn them into a calendar. We will call the method that builds this calendar optimisation.
Four questions
“What do I need to know to decide whether to mark a product down on a Monday?” says Pelin.
Pars writes four questions on the whiteboard.
- If this product stays at full price, how many units will it sell in the weeks left?
- How much will a markdown lift those sales?
- How much stock is there to sell, and where is it?
- What does a unit left at the exit bring in at the outlet?
“Let’s start with the first,” says Pars. “We look at how fast the product is selling today; only on days with stock on the shelf, and separately for every store and every size. We clean that rate of the day’s conditions: the day of the week, special days, any markdown or promotion running that day. Then we carry it forward.”
“But demand melts away over the season,” says Ali.
“The life-cycle curveThe curve showing how a product's sales rise and fade from the week it enters the store. tells us that. We look at how, in past seasons of the same type, a product’s demand fell week by week after launch.”
We answered the second question in the last article: we measure the power of a markdown with the elasticity learned from promotions. The answer to the fourth is in past seasons: a unit left at the exit brings in, on average, a small fraction of its list price at the outlet. We call this the salvage value. Because the salvage value is small, the model is keen to sell the stock within the season.
The third question looks the easiest at first sight. Sellable stock is the stock on the shelf, the stock in transit to the store, the stock in the warehouse and the open orders arriving before the exit. But here the total is not enough; where the stock is matters too.
“A jumpsuit on Izmir 4’s rail sells to Izmir 4’s customers,” says Pars. “The model books the stock on the shelf to that store. The stock in the warehouse, though, it counts as going wherever the demand is.”
“Does it really go there?” says Veli.
“Not always. That’s the assumption that replenishmentSending warehouse stock to stores at regular intervals, according to sales. In the trade it is also shortened to AR or repl; RPT is something else. will take the stock to the right place. It’s an optimistic assumption, and we made it on purpose. We’ll see what it costs at the end of the article.”
Every Monday
Once the four questions are answered, the model does this for every product. For this week it tries every step of the ladder, full price included. For each one it finds the best path to the exit, and picks the one that brings in the most. “Brings in the most” means the sum of the revenue from stock sold in the season and the outlet value of the stock left at the exit.
There are two rules. The price does not go back up; a product marked down this week cannot return to its old step next week. But steps can be skipped; the model can go straight from full price to 50%. The coverage rule, by contrast, came down one step a week.
Every week each store sells the smaller of its stock and its own demand. A store with more stock than demand sells its demand, and the rest stays on the rail. A store with less stock sells its stock, and the demand left unmet is lost.
The easy way to find the best path is to start from the end. In the last week the best step is clear for every stock level: that week’s revenue plus the outlet value of the stock left. In the week before, that week’s revenue plus the best of the last week, already found. And so on backwards to this week. This is called dynamic programming. The extract below is simplified from the case’s working code.
# markdown_calendar/model.py (solve; simplified)
V = np.tile(salvage * list_price * grid, (K, 1)) # every unit left at the exit at its outlet value
for t in reversed(range(T)): # from the last week back to this one
Q = np.empty((K, len(grid)))
for k in range(K): # the step chosen this week
s = weekly_sales(grid, d[t], w, multiplier[t, k]) # each store: the smaller of stock and demand
revenue = s * list_price * (1 - effective_rate[t, k]) * (1 - returns)
Q[k] = revenue + np.interp(grid - s, grid, V[k]) # + the value of the stock left
V = np.array([Q[k:].max(axis=0) for k in range(K)]) # the price does not go back up
The plan is built up to the exit, but only its first week is applied. Next Monday, with new sales, new stock and the stock that has come in, the whole forecast and the whole plan are built again from scratch.
The jumpsuit’s Monday
Back to Veli’s jumpsuit. On the first Monday the optimisation can start, eight weeks before the sale, the jumpsuit’s sellable stock is 6,588 units. The model forecasts that if the jumpsuit stays at full price it will sell 799 units up to the exit. The stock is more than eight times the forecast demand.
“That Monday there are 578 jumpsuits in Izmir 4,” says Veli. “How does the model see them?”
“If Izmir 4’s customers won’t buy that many jumpsuits, it sees the excess as unsellable,” says Pars. “The 1,946 in the warehouse, though, it counts as going wherever the demand is.”
The plan the model builds that Monday: four weeks at 50%, then 70%. The plan expects 547 units to be left at the exit. Only this week’s 50% is applied. The coverage rule says 20% on the same day.
“The plan says we go down to 70% in four weeks,” says Pelin. “When the day comes, will we?”
“A plan isn’t a promise,” says Pars. “It’s built again every Monday, with new numbers.”
And so it turns out. Every Monday the new plan picks 50% again as that week’s step. The jumpsuit only goes down to 70% two weeks after the sale starts.
The result: level with the rule
Now the race. The same flow of customers, the same stock, the same repeat orders; only the calendar changes. The true demand and the true elasticity are part of the world behind the data; in real life there is no such referee. We compared the optimisation with three things: a copy of itself tied to Lumoda’s calendar, the coverage rule, and a copy that knows the true demand.
The copy tied to the calendar touches nothing before sale day, and from sale day on gives everyone at least 30%; it only chooses the depth product by product. The oracle is the free optimisation itself, with one difference: it takes demand and elasticity not from a forecast but from the world behind the data.
| Contribution against Lumoda, two seasons | TRY million |
|---|---|
| Optimisation, tied to the calendar | +10.35 |
| Optimisation, free | +23.63 |
| Oracle | +24.44 |
| Coverage rule | +24.91 |
The first comparison is the price of the calendar. Tied to Lumoda’s calendar, the same optimisation brings in TRY 13.28 million less over the two seasons. Of the two parts of the freedom, whom to mark down and when to start, the bigger one is when: starting early.
The second is the rule. The free optimisation does not beat the coverage rule; over the two seasons the gap is TRY 1.28 million, in the rule’s favour. In summer the rule is ahead, in winter the optimisation, by a little. The two get to the same place by different roads. The optimisation marks down earlier, leaves less dead stockStock left in the warehouse after the season and the outlet window are over, which will never sell. and runs up more markdown cost; the extra stock it sells goes cheap.
“All this calculation,” says Pelin, “to get where the rule gets?”
“In this calculation, yes,” says Pars. “Both do the same thing right: they see the stock in the warehouse too, and mark down early what isn’t selling. That’s where most of the gain is. The rest is fine-tuning.”
The third is the oracle. The oracle gets ahead of Lumoda; the optimisation closes 96.7% of that gap. The rule, though, is a little ahead of the oracle as well. These are the results of a single flow of customers; we look at what happens with other flows in the sixth article.
Why knowing demand is not enough
It is surprising that the copy that knows the true demand gains so little. The reason is that the oracle believes the same stock model. The model assumes the stock in the warehouse will go wherever the demand is; in reality replenishment sends it late, and by its own rules. The model holds each store’s share of the stock fixed over the season; in reality the size customers want sells out first in the high-demand store, and the stock stays on the rail where there is no demand.
So the oracle knows demand correctly, but forecasts sales as wrongly as the optimisation does. Both expect to sell more than they will. The error is not in demand but between demand and sales.
The jumpsuit shows this plainly. The oracle too takes it to 50% on the same Monday, but goes down to 70% much earlier. It sells more; dead stock is only 700 units. But its contribution is TRY 0.20 million, against 0.47 under the optimisation. It clears the stock, but cheaply.
“So even if we knew demand exactly,” says Veli, “the stock could still be in the wrong place.”
“Price doesn’t take the jumpsuit in Izmir 4 to another store,” says Pars. “This calendar’s bottleneck isn’t the demand forecast; it’s the stock model: where the stock is.”
Turn the dial yourself
Below you choose a decision rule and a season; the cards show that arm’s contribution gap, its dead stock, its markdown cost and its STRs. Put the coverage rule and the free optimisation side by side: their contributions are close, but their dead stock and markdown cost differ. Then switch the season between summer and winter; the order of the two changes. The oracle is not on the dial.
- Contribution vs Lumoda's own (TRY m)
- 0.0
- Dead stock (000 units)
- 175.3
- Markdown cost (TRY m)
- 49.1
- Full-price STR (%)
- 52.7
- End-of-season STR (%)
- 88.0
- Contribution vs Lumoda's own (TRY m)
- 0.0
- Dead stock (000 units)
- 166.3
- Markdown cost (TRY m)
- 37.8
- Full-price STR (%)
- 66.7
- End-of-season STR (%)
- 84.6
- Contribution vs Lumoda's own (TRY m)
- 0.0
- Dead stock (000 units)
- 341.7
- Markdown cost (TRY m)
- 87.0
- Full-price STR (%)
- 58.6
- End-of-season STR (%)
- 86.6
- Contribution vs Lumoda's own (TRY m)
- -0.8
- Dead stock (000 units)
- 161.8
- Markdown cost (TRY m)
- 70.5
- Full-price STR (%)
- 52.9
- End-of-season STR (%)
- 89.5
- Contribution vs Lumoda's own (TRY m)
- 0.0
- Dead stock (000 units)
- 156.1
- Markdown cost (TRY m)
- 49.5
- Full-price STR (%)
- 66.9
- End-of-season STR (%)
- 86.0
- Contribution vs Lumoda's own (TRY m)
- -0.8
- Dead stock (000 units)
- 317.9
- Markdown cost (TRY m)
- 120.0
- Full-price STR (%)
- 58.8
- End-of-season STR (%)
- 88.0
- Contribution vs Lumoda's own (TRY m)
- 12.2
- Dead stock (000 units)
- 72.3
- Markdown cost (TRY m)
- 156.4
- Full-price STR (%)
- 50.4
- End-of-season STR (%)
- 98.4
- Contribution vs Lumoda's own (TRY m)
- 12.7
- Dead stock (000 units)
- 93.5
- Markdown cost (TRY m)
- 122.5
- Full-price STR (%)
- 65.0
- End-of-season STR (%)
- 93.8
- Contribution vs Lumoda's own (TRY m)
- 24.9
- Dead stock (000 units)
- 165.7
- Markdown cost (TRY m)
- 278.9
- Full-price STR (%)
- 56.6
- End-of-season STR (%)
- 96.5
- Contribution vs Lumoda's own (TRY m)
- 1.3
- Dead stock (000 units)
- 151.3
- Markdown cost (TRY m)
- 77.6
- Full-price STR (%)
- 51.7
- End-of-season STR (%)
- 90.8
- Contribution vs Lumoda's own (TRY m)
- 7.1
- Dead stock (000 units)
- 132.7
- Markdown cost (TRY m)
- 62.2
- Full-price STR (%)
- 62.9
- End-of-season STR (%)
- 88.9
- Contribution vs Lumoda's own (TRY m)
- 8.4
- Dead stock (000 units)
- 284.0
- Markdown cost (TRY m)
- 139.8
- Full-price STR (%)
- 56.5
- End-of-season STR (%)
- 90.0
- Contribution vs Lumoda's own (TRY m)
- 5.3
- Dead stock (000 units)
- 107.8
- Markdown cost (TRY m)
- 112.1
- Full-price STR (%)
- 52.9
- End-of-season STR (%)
- 94.6
- Contribution vs Lumoda's own (TRY m)
- 5.1
- Dead stock (000 units)
- 117.3
- Markdown cost (TRY m)
- 92.0
- Full-price STR (%)
- 66.9
- End-of-season STR (%)
- 90.7
- Contribution vs Lumoda's own (TRY m)
- 10.4
- Dead stock (000 units)
- 225.2
- Markdown cost (TRY m)
- 204.1
- Full-price STR (%)
- 58.8
- End-of-season STR (%)
- 92.9
- Contribution vs Lumoda's own (TRY m)
- 10.6
- Dead stock (000 units)
- 65.3
- Markdown cost (TRY m)
- 167.8
- Full-price STR (%)
- 48.1
- End-of-season STR (%)
- 99.2
- Contribution vs Lumoda's own (TRY m)
- 13.0
- Dead stock (000 units)
- 79.7
- Markdown cost (TRY m)
- 145.2
- Full-price STR (%)
- 62.9
- End-of-season STR (%)
- 95.6
- Contribution vs Lumoda's own (TRY m)
- 23.6
- Dead stock (000 units)
- 145.0
- Markdown cost (TRY m)
- 313.0
- Full-price STR (%)
- 54.4
- End-of-season STR (%)
- 97.7
Every combination came with the page; nothing is fetched from a server.
What is hard in your data
Knowing the in-stock days. Full-price demand is measured only from days with stock on the shelf. For that you need the answer to “was the shelf empty?” for every store, every size and every day. Without it, a product that sold out looks as if it had little demand.
Clean promotions to measure elasticity. The calendar’s whole depth decision rests on elasticity. If promotions go on products that are not selling, the measured elasticity falls and the calendar shies away from markdowns.
Customers waiting for the sale. This world’s customers do not know the markdown calendar, and do not remember the old price. In a real chain an early, deep markdown can teach customers to wait. The model does not take this into account.
Where the stock is. Your replenishment has its rules, its packs and its delays; transfers between stores are expensive too. This is one of this article’s findings: what limits the calendar is not the demand forecast but where the stock is. Stock going from the warehouse to the stores is the subject of the Warehouse to Store series.
Effects across products. The model looks only at the product it marks down. When a marked-down product sells out early, part of its demand moves to neighbouring products through substitutionA customer who cannot find the product they want buying another one instead. The sale stays with the company, so not all unmet demand counts as lost.. This effect falls outside season contribution and is not small; we measure its size in the sixth article.
No referee to measure with. Here we could race the optimisation against the rule with the same stock and the same customers. In a real chain a season is lived once; the difference between the two is lost inside everything else that happens in the season.
We have all the arms. In the last article we put them all on the same table: what do we measure success by, why do markdown cost and gross profit mislead, and is the result the same with other flows of customers?