Interviews and work sampling are respectable ways to get the minutes into a time equation, and for a first model they are often good enough. They stop being good enough when the warehouse handles a thousand orders a day and the equation needs to know that a pick with twelve lines from three zones takes longer than a pick with one line from the fast-mover aisle. That information already exists, because the warehouse, transport and plant systems record every scan, every stop and every machine state with a timestamp. Turning those events into minutes per order is less work than people expect, and the logic is the same whatever the system is called. What follows is the logic, not the code for any particular product, because I have not seen two of these systems that name their fields the same way and I would rather not pretend otherwise.
How do you turn WMS, TMS or MES event logs into minutes per order for a time equation?
Almost every log carries five fields: a timestamp, an event type, a reference such as an order or shipment or production order, a resource such as a user, device, vehicle or machine, and a location or quantity. Sort by resource and then by time. The gap from one event to the resource’s next event is the duration of the task the first event started. Cap any gap above a threshold, usually 15 to 30 minutes, and treat it as idle or a break rather than attributing it to the order. Split tasks that serve several orders, a pick tour or a multi-drop route, in proportion to lines, units or stops. Sum the minutes by order, then by customer. Everything else is edge cases: missing end events, shift boundaries and shared tasks, and each has a simple rule.
The five fields, and where each system keeps them
| Field | WMS | TMS | MES |
|---|---|---|---|
| Timestamp | Scan time | Stop arrival and departure, GPS ping | Status change time, cycle start and end |
| Event type | Pick, put-away, replenish, pack, load, count | Depart, arrive, unload, return, wait | Setup start, run start, stop, downtime code, quality hold |
| Reference | Order, pick list, wave, shipment | Route, stop, shipment, delivery | Production order, operation, batch |
| Resource | User, device, truck | Vehicle, driver | Machine, line, operator |
| Location or quantity | Bin, zone, units picked | Stop address, kilometres, units delivered | Units produced, scrap, line number |
You will find more fields than these, and most of them are noise for a cost model. Weight and cube help the warehouse equation; the customer on the delivery helps the transport one; the product on the operation helps the plant one. Take the five, add the two or three that the equation will use, and leave the rest.
From events to durations: the gap method
A scan tells you when a task started, not how long it took. The duration comes from the next scan by the same person or machine. Order the events by resource and timestamp, and for each event take the time to the following event of the same resource as the duration of the task the first event began. In any SQL that supports window functions this is a single expression, and I will write it as a pattern rather than as code for one dialect: partition by resource, order by timestamp, and take the lead timestamp minus the current one. In Power Query it is a sort, an index, and a self-merge on index plus one within each resource.
An illustrative morning for one picker, with invented times. A pick scan for order A at 08:02, a pick scan for order A at 08:05, a pick scan for order B at 08:11, a pack scan for order B at 08:14, and a pick scan for order C at 08:41. The gap method gives order A three minutes and six minutes, nine in all; order B three minutes of picking and then a 27-minute gap before the next scan. That 27 minutes is the question the next section answers.
The cap: what a long gap is, and is not
A gap of 27 minutes after a pack scan is rarely 27 minutes of packing. It is a break, a conversation, a forklift with a flat battery, or a task the system does not log. Attribute it to order B and B becomes the dearest order of the day for no reason. The rule I use, and would adjust per site, is a cap: any gap above a threshold, 15 minutes in a busy pick zone and up to 30 in a slow one, is truncated to the median duration for that event type, and the excess goes to a pool of unattributed time. That pool is real, it is paid for, and it belongs in the cost of unused capacity rather than on any order. The threshold should be set by looking at the distribution of gaps for each event type, where there is usually an obvious knee, rather than by guessing. The unused capacity page explains what to do with the pool once it is measured.
Shared events: one pick tour, twelve orders
A batch pick or a wave serves several orders in one walk, and the scans carry the pick list rather than the order. The rule is to split the tour’s minutes across the orders it served in proportion to something the tour actually did for each: lines picked is the usual choice, units where the pick is unit-driven, and a fixed share per order for the walking component if the log lets you separate walking from picking. None of these is exactly right; all of them are far closer than an average per order across the whole warehouse. Keep the rule written down, because the split rule is the one thing an auditor will ask about.
Missing ends, shift boundaries and overnight
Three edge cases cover most of what goes wrong. The last event of a shift has no next event, so its duration is undefined; use the median for that event type, and the same for the first event after a break if the system logs breaks. A gap that crosses a shift boundary is not a task; cut it at the boundary and let the excess go to the unattributed pool. And an event with a next event on the following day is a missing end, not a 14-hour task; treat it as the shift-end case. Together these three rules usually leave a small residue of odd durations, and I would look at the twenty longest by eye before trusting the rest, because they are where the log is telling you something about the process.
TMS: stops, dwell and the driving between
Transport logs are simpler in one way and harder in another. Simpler, because each stop has an arrival and a departure, so dwell time per stop, which is mostly unloading and paperwork, is direct and needs no gap method. Harder, because the driving time between stops on a multi-drop route belongs to all the deliveries on the vehicle, and there is no single right way to split it. Two rules are defensible. The incremental rule charges each stop the driving time from the previous stop, which favours the customer who happens to be first on the route. The proportional rule splits the whole route’s driving time by stop, by units or by distance from the depot, which is fairer and slightly less true. I usually use proportional by stop for the driving and direct for the dwell, and I say so in the model documentation. The route profitability page covers what the result looks like by customer.
MES: setup, run and downtime, and where each goes
Plant logs record status changes per machine: setup started, run started, stopped with a reason code, run resumed, order completed. Run time per production order is direct and goes to the units the order produced. Setup time goes to the order as a whole, so that a small run carries its own changeover rather than a share of the year’s average; the setup and changeover page has the arithmetic. Downtime is the one to be careful with. A breakdown during order X is not a cost of order X; it is unused capacity, and if it is charged to X the product made that day looks expensive for a reason that will not repeat. The reason codes in the log are what let you separate a planned changeover from an unplanned stop, and they are worth keeping even though they are the messiest field in the file.
From minutes per order to a time equation
Once every order has a measured duration, the equation is a fit rather than a guess. Take the orders for a closed month, regress the minutes on the candidate drivers, lines, units, zones visited, order type, channel, and keep the coefficients that are stable across months and make operational sense. A base of about eight minutes plus one and a half per line, to take an invented example, is the kind of result that comes out, and the value of the log is that you can check it against next month’s data rather than against someone’s memory. Where the fitted equation and the interview estimate disagree by a lot, the log is usually right about the average and the interviewer is usually right about why. The time equation reference covers the form of the equation, and the article on estimation methods compares the log approach with the alternatives on cost and error.
What the log will not tell you
It records what was done, not why, and not what was not logged. A returned order that nobody scanned costs real time and shows nothing. An exception handled by a supervisor at a desk with no scanner is invisible. And a log records people, which makes it personal data in most jurisdictions; aggregate to the role and the event type before the data leaves the operations team, keep the user identifier out of the cost model, and have the works council or the equivalent in the room before the first extract. The article on measuring times without surveillance covers what the rules permit and what they do not, with the caveat that it is not legal advice.
The scan tells you when a task started. The next scan by the same person tells you how long it took, and the rules for gaps, shares and breaks are what make the answer fair.
Where to start
One system, one closed month, one event type: picks in a WMS, stops in a TMS, or run and setup in an MES. Export the five fields, apply the gap method and the cap, and look at the twenty longest durations by eye. If the medians agree with what the supervisors expected, you have a driver you can refresh every month. If they do not, you have either found a process problem or a logging gap, and both are worth knowing before the equation is written. Either way it is a week of work rather than a project, and I would rather see a company do that week than argue about interview estimates for a quarter.
Related reading: cost to serve in logistics, TDABC in manufacturing, the cost driver library and a first look at cost per order, line, invoice, complaint and visit.
