Systems and records
Keep the wrong unit: building a procurement unit conversion error dataset
By SourceX Editorial · Updated
9 sections
Short answer
A procurement unit conversion error dataset is only useful if the error survives preparation. For every case, keep three readings of the same quantity: the value and unit the source document carried, what the system's conversion produced, and what the business finally settled. Then label which reading was right and who decided. Normalizing first erases the pack, factor, catch-weight and rounding failures the dataset exists to test.
System export
Keep the wrong unit
Key takeaways
- Keep three readings per quantity, as recorded, as converted and as settled, and label which one was right and who confirmed it.
- Pack versus each, conversion factors, catch weight and rounding each need their own rule for the correct answer.
- In metasfresh's release notes, 32 of 1,392 distinct fix entries (2.3 percent) concern units, pack levels, weights or rounding: too rare for random sampling to cover.
- One delivery can have two right answers, because billing on catch weight or nominal weight is a contract term, not arithmetic.
- Decoys such as genuine pack changes stop a model from scoring well by flagging every conversion.
What should a procurement unit conversion error dataset preserve?
Every quantity in three readings, plus a verdict. Keep the value and unit exactly as each source document carried them, the value the system's conversion produced, and the quantity and price the business finally settled, then record which reading was right, why, and who confirmed it. A dataset that stores one cleaned quantity per line has already answered the question it was meant to ask.
Preparation habits push the other way. Converting every quantity to a base unit makes joins work and totals add up, and for a reporting warehouse that is the right call. For a test set it destroys the evidence: once 40 cases and 386.4 kilograms have become one number, a model can never be shown the conflict, so it can never be graded on noticing it.
What follows covers the error families that matter in purchasing records, what one open-source ERP's fix history shows about where they hide, a case card and a constraint matrix for labeling, an illustrative case with two correct answers, and scoring rules that do not reward blanket suspicion.
Four ways a purchased quantity changes meaning on its way to the invoice
Four families of unit error recur in purchasing records, pack-versus-each confusion, conversion factors, catch weight and rounding, and each needs a different rule for the correct answer:
- Pack versus each. The order unit, stock unit and price unit can all differ for one item, so a case price applied to eaches multiplies the bill by the pack size while every number on the line looks plausible. Standards keep the levels apart: in the GS1 syntax dictionary, the identifier for the item contained in a logistic unit (AI 02) must travel with a separate count of those items (AI 37).
- Conversion factors. A factor can be wrong, stale after a pack change, stored in the wrong direction or valid only for one lot. metasfresh, an open-source ERP, stores both directions of a conversion; when only one is given it computes the inverse to 12 decimal places, and it rounds each converted quantity to the target unit's precision, so a factor of one third already loses information.
- Catch weight. Some goods are ordered and handled in countable units but priced by what they actually weigh. SAP's catch weight documentation describes two linked units per product, a valuation unit such as kilograms and a logistics unit such as pieces or cartons, and NIST Handbook 130 treats packages with no fixed pattern of net contents as random packages labeled with net weight, unit price and total price. Whether an invoice follows the nominal or the weighed quantity is a contract term; metasfresh models it as a price setting with two values, catch weight or nominal, and its helper for reading that setting falls back to nominal when the value is empty.
- Rounding and decimal position. Rounding per case, per line or per document produces different totals, and a misplaced decimal moves a weight by a factor of ten or more. In GS1 barcodes, the last digit of identifiers such as 310n (net weight in kilograms) sets the number of implied decimal places, and GS1's 2016 change notice said earlier specifications were unclear about which values were allowed. Kilograms and pounds also use separate identifier ranges (3100 to 3105 against 3200 to 3205).
How often do unit errors show up in one ERP's fix history?
Rarely by count, which is the argument for keeping them on purpose. metasfresh, the open-source ERP whose catch-weight setting appears above, publishes release notes that list fix entries for 151 releases, from 4.57.56 to 5.175. Counting distinct fix entries by their issue link and matching titles against a stated keyword rule, 32 of 1,392 entries (2.3 percent) concern units, pack levels with quantities, weights or rounding: 11 mention a unit of measure, 11 a pack level with a quantity, 8 a weight (3 of them catch weight) and 5 rounding or precision, with 2 entries in more than one family. The rule ignores case and counts a title that contains uom, unit of measure or price unit; weight, gewicht or the word kg; precision or the words round, rounded, rounding or rounds, unless it says rounded corners; or a pack level and a quantity word. A pack level is TU, CU or LU, singular or plural, standing alone or joined to a quantity word without a space or with a hyphen (QtyCU, TU-Qty), or packing instruction, packing item or packmenge; a quantity word is qty anywhere, or the words quantity, quantities, capacity, count, counted, menge, per or sum.
The titles read like a test plan. 'Qty TU not correct in purchase invoice jasper'. 'Average purchase cost is updating the Price as per the Price Unit and not as per the Items Base UoM'. 'Reactivate Shipment, update Shipmentline delivery catch weight => does not update invoice candidate', a weight corrected after shipment that never reached billing. 'Linenetamt not rounded to currency precision'. 'Materialentnahme with kg palettes creates extra 0.001Kg TU', a rounding residue that created a phantom trading unit.
The pattern continues past the release notes. A January 2025 commit fixed purchase planning where 'UOM conversion not used correctly for products where stock UOM != price UOM'. An August 2026 commit records that twelve catch-weight steps of 1.46 kg, logged after a duplicate pick, summed to 17.520000000000003 on a picking screen, because plain floating-point addition had accumulated error that the display then printed in full.
Read the 2.3 percent with care. These are software defects in one product, matched by keywords rather than read one by one, and at least one match (a cursor jumping between quantity fields) is an interface bug, not a wrong quantity. What the count does show is scarcity: a random sample of 200 fix entries would be expected to hold about five unit-related ones, too few to grade a model on four families. Stratify by family instead, with a fixed number of cases in each.
The case card: three readings and the answer key
Use one card per case, filled from the source documents and the settlement trail rather than from anyone's summary. These fields are the minimum that lets a reviewer reproduce the label and lets a grader check a model's reasoning as well as its final number.
Keep raw unit strings as written, not the codes a preparation script mapped them to. If one supplier writes CS12 on one invoice and case on the next, that variation is part of the test. The values below come from the illustrative salmon case later on this page:
| Field | What it holds | Illustrative value | What normalizing first would erase |
|---|---|---|---|
| As-recorded quantities | Each document's value and unit string exactly as written: order, receipt, scale ticket, invoice | Order 40 CS; receipt 40 CS with scale weights totaling 386.4 kg; invoice 400.0 kg | The conflict itself, because one cleaned number replaces four readings |
| Conversion applied | Factor, direction, where it came from and the date it took effect | 10 kg per case, from the item master | Which factor was used, so a stale or inverted factor looks correct |
| Rounding rule | Precision and rounding mode at each step, and whether rounding is per case, per line or per document | Weights to 0.1 kg per case, summed per line | The step where grams or cents were created or lost |
| Governing unit term | The contract or price-list clause that says which unit sets the price | Invoice on catch weight | The rule that decides which reading is right |
| Settled outcome | What was finally received, invoiced, paid or credited, with document references | Pay for 386.4 kg; credit requested for 13.6 kg | The answer key, replaced by whatever the converter computed |
| Error family and label | Pack versus each, factor, catch weight, rounding or decimal position; error, correct or decoy | Catch weight; error, nominal weight billed on a catch-weight contract | Family balance, so a test set can quietly hold no catch-weight cases |
| Authority and evidence | Who confirmed the label and which records they relied on | Accounts payable lead, from the scale tickets and the contract clause | Accountability for the label |
| Consequence | Money, stock or service effect of acting on the wrong reading | 13.6 kg overbilled, 3.4 percent of the nominal weight | The stakes, which set how heavily a miss should count |
Constraint matrix: when the obvious conversion is the wrong answer
Each error family has a tempting automatic fix and a constraint that makes it wrong. The matrix works as the labeling rulebook: a case takes its label from the constraint column, never from what the converter did.
Two rows are decoys on purpose. A nominal-weight contract and a genuine pack change both look like errors to a suspicious model, and both are correct:
| Error family | Tempting normalization | Constraint that overrides it | Correct label rule |
|---|---|---|---|
| Pack versus each | Assume the invoice line uses the order unit | The invoice states a price per each against a price per case on the order | Error when quantity times price departs from the order total by the pack factor; settle at the order price per order unit |
| Stale factor | Apply today's item-master factor to old documents | The factor changed after the document date | Use the factor in force on the document date and flag cases that straddle the change |
| Inverted factor | Accept any factor that yields a plausible number | The factor was stored in the wrong direction, 12 instead of one twelfth | Error when the converted quantity is off by the square of the factor, 144 times for a 12-pack |
| Catch weight | Convert cases to kilograms at the nominal weight | The contract invoices on weighed quantity | Settle at the scale-ticket weight; nominal billing is an error |
| Catch weight decoy | Same conversion as above | The contract invoices on nominal weight | Nominal billing is correct; flagging it fails the case |
| Rounding | Round each case or line before summing | The contract or tax rule rounds at document level | Recompute at the stated precision and label the residue, however small |
| Decimal position | Read the weight digits as written | A GS1 identifier's last digit sets the implied decimals | Error when the decimal count does not match the identifier |
| Genuine pack change decoy | Treat a new pack size as an entry error | The supplier issued a change notice and a new factor took effect on a stated date | Correct; the factor history must show the change date |
Illustrative case: forty cases of salmon, two right answers
Illustrative: the supplier, item and prices are invented, and the arithmetic is reproduced in the writer's script. A distributor orders 40 cases of fresh salmon fillets at 14.20 per kilogram. The item master says a case weighs 10 kg, so the order converts to 400 kg. At receiving, the scale tickets for the 40 cases total 386.4 kg. The supplier invoices 400.0 kg, or 5,680.00.
The three-way match passes, because it compares the invoice with the receipt converted at the nominal factor, 40 cases times 10 kg, and both sides read 400. If the contract says the supplier invoices on catch weight, the settled amount is 386.4 kg, or 5,486.88, and the supplier owes a credit of 193.12 for 13.6 kg, 3.4 percent of the nominal weight. If the contract says nominal weight, the 5,680.00 invoice is right and the scale tickets play no part in payment. Same documents, two correct labels, decided by a clause the converter never reads.
Two siblings make the case harder to game. In the rounding sibling the receiving scale prints whole kilograms: the 40 case weights, which run from 9.6 to 9.8 kg, all round to 10, the total becomes 400 and the overbilling vanishes from the record before anyone looks. In the pack sibling, an order for 10 cases at 42.00 per case comes back as 120 each at 42.00, a 5,040.00 invoice against a 420.00 order, and the right answer is 3.50 per each.
A model that catches the salmon overbilling and also flags the nominal-weight decoy has learned suspicion, not the rule. Score the pair together.
Why not normalize everything and unit-test the converter instead?
Because a converter test checks the rule the software follows today, not the answer the business accepted. Testing conversion code is necessary, and it is the cheaper option, but it leaves the decision untested: which reading governed, what was paid and what was credited.
metasfresh shows how quickly a converter's expected answers can move. A May 2020 commit switched quantity conversion to rounding up and, in the same change, adjusted the tests 'to fit the new rounding mode'. The current code's unit-precision class returns rounding up as its rounding mode, with a comment explaining that converting 300 grams of an item counted in one-kilogram pieces should give one piece, not zero. That may be right for picking. It says nothing about what a supplier should be paid, and a test set built from converted values would have changed its answer key overnight.
Normalization still has a place. At inference a model can be handed converted quantities, provided the record keeps the raw readings and the case is graded against the settled outcome. Note which shortcut is cheapest in the salmon case: paying the invoice that matched, which is exactly the action that breaks a catch-weight contract.
Scoring a unit error case without rewarding blanket suspicion
Score detection, correction and rationale separately, and include decoys that must pass untouched. One pass mark hides whether a model found the error by reasoning or by flagging every line that involved a conversion. Five checks per case:
At a glance
Scoring a unit error case without rewarding blanket suspicion
- Detection: the model names the conflicting readings with their units; a number without its unit earns no credit.
- Governing term: the model identifies the clause or price setting that decides which reading pays; the right total reached through the wrong rule fails.
- Correction: the settled quantity and amount match the answer key at the stated precision.
- Escalation: when the factor history or the governing term is missing from the record, stopping to ask is the correct answer and scores as a pass.
- Decoys: genuine pack changes and nominal-weight contracts come back with no exception raised, and every false alarm counts against the model.
Finding real unit error cases, and the limits of this design
Real cases sit in records that already disagree with each other: invoice holds with quantity or price reason codes, scale tickets attached to receipts, credit notes that cite pack size or weight, and item-master change logs that date a factor. Each case needs the card's fields, with supplier and personal details removed and the record owner's approval to use them.
SourceX keeps no catalog of such records; it looks for them among U.S. businesses once a buyer has described the need. A request for unit error cases works best when it names the error families and decoys wanted, the number of cases per family, the language, the file format, the timing and the license terms for training or evaluation use.
This design does not measure how often unit errors occur in any company's purchasing, what they cost, or how well any model detects them. The metasfresh count describes software defects in one product's release notes under a keyword rule, and the salmon case is invented. Treat the four families as a starting taxonomy and extend it with the units your own suppliers actually use.
Frequently asked questions
What is a unit of measure error in procurement?
It is a mismatch between the unit a quantity or price is expressed in and the unit another document or system assumes. Common forms are a case price applied to eaches, a wrong or outdated conversion factor, a nominal weight billed where the contract uses actual weight, and rounding at the wrong step. Each can pass a quantity match and still produce the wrong payment.
Should procurement training data be normalized to one unit of measure?
Normalize for analysis if that helps, but keep the raw value and unit string, the conversion applied and the settled outcome in the record. A dataset that holds only normalized quantities cannot test whether a model notices a unit conflict, because the conflict has already been removed.
What is catch weight, and why does it break invoice matching?
Catch weight goods are handled in countable units such as cases but priced by their actual weight. If matching converts cases to weight at a nominal factor, an invoice billed at nominal weight will match even when the contract requires payment on the weighed amount. Which weight governs is a contract term the record has to carry.
How many unit error cases does an evaluation set need?
Set a fixed number per error family rather than sampling at random, because these errors are rare by count: in metasfresh's release notes they make up 2.3 percent of distinct fix entries. Add decoys to each family so false alarms can be counted. The exact number depends on how small a difference between models you need to detect.
How should a dataset label a legitimate change in pack size?
As correct, with the date the new factor took effect and the supplier's notice or new item number as evidence. Such cases teach a model that a changed ratio is not automatically an error, and they test whether it applies the factor in force on each document's date.
Sources
- metasfresh's release notes list fix entries per release; 32 of 1,392 distinct fix entries match the article's unit keyword rule, with the quoted titles. Source
- metasfresh's price setting for the invoiced quantity has two values, catch weight and nominal weight, and falls back to nominal when empty. Source
- metasfresh computes a missing inverse conversion multiplier to 12 decimal places and rounds converted quantities to the target unit's precision. Source
- metasfresh rounds quantities up at unit precision, with a comment that 300 grams of a one-kilogram piece should convert to one piece. Source
- Twelve 1.46 kg catch-weight steps summed to 17.520000000000003 with plain floating-point addition (August 2026 commit). Source
- A May 2020 commit changed quantity conversion to round up and adjusted the tests to fit the new rounding mode. Source
- A January 2025 commit fixed purchase planning where UOM conversion was not used correctly when stock and price units differ. Source
- GS1's syntax dictionary pairs the contained-item identifier (AI 02) with a required count (AI 37) and gives kilogram and pound net weights separate identifier ranges. Source
- GS1's 2016 change notice: the last digit of identifiers such as 310n gives the number of implied decimal places, and earlier specifications were unclear about allowed values. Source
- NIST Handbook 130 defines random packages as having no fixed pattern of net contents and requires net weight, unit price and total price on random weight packages. Source
- SAP's catch weight documentation pairs a valuation unit such as weight with a parallel logistics unit such as piece or carton. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.