Margin erosion is a movement of weeks that gets discovered in a photograph taken monthly. A customer starts ordering twice as often in half the size, a buyer shifts the mix toward the thinnest margins, each order takes a few minutes longer, and by the time the whale curve shows the account sliding down the tail, two closes have passed and the terms that caused it were agreed in week two of the first. An agent can watch the signals as they happen and say, before the close, that this customer’s margin is projected to fall. This article is the design of that agent: the signals it watches, how each becomes a projected margin using the existing model, the three conditions an alert has to meet, what it says and to whom, and what the agent may not do. The worked figures are invented and labelled so.
What does a margin erosion agent watch, and when should it raise an alert?
Three families of signals per customer, read weekly from the order file and the operational logs: mix, the share of revenue in low-margin products and channels, which moves the gross margin; order behaviour, orders per week, lines per order and average order value, which moves the cost to serve through the time equations; and service time, minutes per order in picking, dispatch, customer service and returns, which moves it again. A fourth, price and terms, discounts and credit days, is checked as a confirming signal. Each is converted into a projected contribution margin using the current time equations and the last approved capacity cost rate, so the projection speaks the model’s language and can be checked against the close. An alert fires only when three conditions hold at once: the projected move is at least two margin points, it has held for three consecutive weeks, and the annualised amount clears a materiality floor. The alert goes to the account owner and the controller together, states the signals with their numbers and what would reverse them, and is confirmed or rejected at the close, which is how the threshold gets tuned. The agent changes no price, no term, no model and never contacts the customer.
Why the close is too late
The monthly customer P&L is right and slow. It is slow because the behaviour that produced it started up to nine weeks before anyone read it, and by then the sales conversation that could have changed the terms has been had, without the number. The twelve signs that a company needs cost-to-serve analysis are mostly signs that this delay has been running for years. The agent does not replace the monthly figure, which remains the truth. It watches the inputs to that figure, weekly, and projects where the figure is heading, so that the conversation can happen while the terms are still negotiable.
The three families of signals, and the fourth
Mix. From the order file: the share of a customer’s revenue in each product family and channel, against the customer’s own trailing average. Each family carries a standard gross margin, so a shift in shares becomes a projected gross margin without any allocation.
Order behaviour. Orders per week, lines per order, average order value, and the share of orders under the agreed minimum. These are the drivers of the order-handling and delivery time equations, so a change in them is a change in minutes, and minutes at the approved rate are cost. The case where small and frequent is the right answer exists, and order frequency against opportunity cost is about it; the agent does not judge the case, it prices it.
Service time. Minutes per order, from the warehouse, transport and service logs: picking minutes per line, dispatch minutes per order, customer-service touches and their duration, returns and credit notes, redeliveries. Where the model runs continuously on event streams, these are already accumulated per customer per day; where it runs monthly, the agent reads the logs weekly through the same event-to-driver logic.
Price and terms, as a confirming signal. Discount depth against the agreed schedule, credit days taken against terms, and free-delivery orders against the minimum. These are checked when one of the three families moves, not on their own, because a price signal alone is a commercial decision someone took on purpose, and the agent is not the place to second-guess it.
From a signal to a projected margin, with invented numbers
The projection uses the model as it is: the customer’s standard margins by family, the time equations, the last approved rate, and the customer-specific costs that do not move week to week, such as account management, credit and returns handling, held at their last monthly value. An invented distributor customer, 1.2 million euros a year, 100,000 a month, watched over four weeks.
| Element (monthly, invented) | Baseline | Projected from the last three weeks | Signal that moved it |
|---|---|---|---|
| Revenue | 100,000 | 100,000 | none, held flat on purpose |
| Gross margin | 24,000 (24.0%) | 21,500 (21.5%) | Mix: entry-range share up |
| Orders per month | 26 | 48 | Order behaviour: 6 to 11 orders a week |
| Minutes per order (picking, dispatch, service) | 38 | 41 | Service time: longer picks, more touches |
| Cost to serve, at 0.62 per minute plus 42 delivery per order | 26 x (38 x 0.62 + 42) = 1,704.56 | 48 x (41 x 0.62 + 42) = 3,236.16 | Both families |
| Other customer-specific costs, held | 8,300 | 8,300 | none |
| Customer contribution | 13,995.44 (14.0%) | 9,963.84 (10.0%) | A projected move of 4.0 points |
Two things about the arithmetic. The revenue is held flat because the agent is projecting what the current behaviour would do to the month, not forecasting sales; if orders per month nearly doubled and revenue stayed the same, the average order halved, which is the whole story of this customer. And the cost-to-serve line is small next to the mix effect in euros, about 1,530 against 2,500, but it is the line the sales representative can change by renegotiating the minimum order, whereas the mix is the buyer’s decision.
The alert threshold: three conditions at once
Size. The projected contribution moves by at least two margin points against the customer’s own baseline, the trailing three closed months. Two points is a starting value, not a law.
Persistence. The projection has held for three consecutive weekly reads. This is the condition that stops a single large order, a stock build before a promotion or a holiday week from firing an alert.
Materiality. The annualised amount of the projected move clears a floor, in the example 4 points of 1.2 million, about 48,000 euros a year, against a floor set at, say, 5,000. The floor exists so that the agent does not fire on a 30,000 euro customer whose margin fell four points, which is 1,200 euros a year.
All three, together. The reason is not caution for its own sake; it is that an alert channel with false positives in it is an alert channel nobody reads. The fourth signal family adds a rule of its own: a mix move alone, or a price move alone, does not fire, because each on its own may be a decision someone made deliberately; either of them with an order-behaviour or service-time move does.
What the alert says, and who receives it
The customer and the projected move, in points and in annualised euros. The signals that caused it, each with its number, its baseline and the week it started. The share of the move that is mix, which the buyer controls, against the share that is cost to serve, which the terms control, because the two lead to different conversations. What would reverse it, stated as the model computes it: this customer returns to the baseline margin if orders per week fall back to seven at the current average, or if the entry-range share falls back under the old level, or if the delivery minimum is enforced. And a suggested next step from a short list the company approved in advance: a call, a review of the minimum order, a review of the delivery terms. Nothing else, and nothing invented.
It goes to the account owner and the controller, together, at the same time. Not to either alone, and not to the CFO, who sees it at the close as confirmed or rejected. The recipient list is part of the design, because a warning that reaches only finance is a report and a warning that reaches only sales is an opinion.
What the agent must not do
Change a price, a discount, a minimum order or a delivery term; those are commercial decisions and the alert is an input to them. Change anything in the cost model: the projection uses the approved rate and equations and does not adjust them, and if the service-time signal suggests an equation is wrong, that is a case for the variance investigation agent, not for this one. Label a customer unprofitable, because the projection is at last month’s rate with unused capacity unknown, and the word belongs to the close. And contact the customer, ever, in any channel, for the reason that a projection sent outside the company becomes a claim the company made.
How the threshold gets tuned
At each close, every alert of the month is marked confirmed, the close showed a move in the same direction of at least half the projected size, or not. The ratio over a quarter is the agent’s precision, and it is the only number that should change the threshold. Too many unconfirmed alerts: raise the persistence to four weeks before touching the size, because most false positives are timing. Too few alerts and the close keeps finding erosion the agent missed: lower the size before the materiality floor, because the misses are usually customers who moved slowly and steadily under two points. The record of alerts and outcomes is kept with the run, and it is the evidence that the agent’s projections are calibrated, which is the question a board should ask before an alert is ever used in a commercial conversation.
Where this goes wrong
The baseline is the customer’s best month rather than the trailing three, so every customer is eroding by construction. The service-time signal is fed from a log whose status events are not effort, the second of the four event-log limits, and waiting time becomes projected cost. And the mix signal is computed on list prices rather than the customer’s actual prices, so a customer who buys the same products at a new discount shows no mix move and a large margin move, which the agent attributes to nothing.
The close tells you what a customer cost. The agent tells you, three weeks earlier, what they are about to cost, in the model’s own units. The alert is only worth sending if the close would have confirmed it.
Where to start
Take the twenty customers whose contribution moved most at the last close and ask, for each, which of the three families moved first and when. That exercise shows which signals your data can actually see, and it usually shows that order behaviour is visible three closes before mix is. Build the order-behaviour signal alone, weekly, for a quarter, with the three conditions, and compare its alerts to the closes. Add service time when a log exists, and mix last, because it needs the standard margins by family to be trusted. The ranking of customers after cost to serve is the monthly truth the agent’s projections are measured against, and presenting the whale curve to a sales team is how the alerts stop being finance’s problem.
Related reading: cost to serve, customer profitability beyond revenue, the six monthly tests that catch model drift and the true cost of a discount.