Platform how-to

Keep your IDs consistent: leading zeros, prefixes and the small differences that stop files from matching

Most failed matches between two files come down to an ID that looks a little different on each side. A zero dropped here, a prefix added there. Here is how to spot it and keep it from happening.

Storek team5 min read

Funnel of 1,040 June orders, 390 unmatched as exported, 352 of them because an ID lost its leading zeros and 38 still unmatched, opened into a table of exported and CRM IDs.
Sample dataDrilling into orders that failed to match because of leading zeros. Illustrative data.

Priya runs operations at Larkspur Garden Supply, a small wholesaler that sells seeds, tools and planters to garden centres. Every month she joins two files: the order export from the sales system and the customer list the accounts team keeps. She wants a simple table of revenue by customer region.

One month the totals looked wrong. A third of the orders had no region at all. Nothing had changed in the business. What had changed was that someone on the accounts team had opened the customer list, sorted it, and saved it again. Every customer number like 00417 was now 417. The order export still said 00417. To a person those are the same customer. To a matching step they are two different strings, and so the orders quietly fell through.

This is the most common reason two files refuse to connect, and it is almost always fixable in minutes once you know what to look for.

What “the same ID” looks like when it isn’t

An ID can drift in a handful of ways as it passes between systems and people. Here is one Larkspur customer, as it appeared in five different places.

Where it came fromHow the ID lookedProblem
Sales system order export00417Reference form
Customer list, after re-saving417Leading zeros dropped
Invoicing toolC-00417Prefix added
Delivery notesc00417 Lower case, no dash, trailing space
Old price list417.0Saved as a decimal number
Sample dataOne customer, five spellings of the same ID. Each highlighted row fails an exact match against the first.

Every one of those rows refers to the same garden centre. None of them would match the first row exactly.

Six habits that keep IDs lined up

  1. Treat IDs as text, never as numbers

    An ID is a label that happens to be made of digits. You never add customer numbers together. When you open or import a file, mark ID columns as text so the zeros stay. If your tool asks what type a column is, the answer for anything called a number, code or reference is text.

  2. Pick one form and write it down

    Decide whether your customer IDs carry their zeros and their prefix, then note it somewhere the team will see it, even a line at the top of a shared folder. “Customer IDs are five digits with leading zeros, no prefix” settles arguments before they start.

  3. Strip the decoration before you compare

    Prefixes like C-, CUST or # and stray spaces are decoration. Before matching, take a copy of the ID column and remove them, make everything the same case, and trim spaces at both ends. Keep the original column too, so you can always see what came in.

  4. Check that a prefix means only one thing

    Sometimes a prefix carries meaning. If C-123 is a customer and S-123 is a supplier, stripping both to 123 would merge two different companies. Look at which prefixes appear in the column before you remove any. If there is more than one, keep it as a separate column.

  5. Watch for decimals and scientific notation

    Long numeric IDs can come back as 417.0 or 4.17E+11 after a round trip through a spreadsheet. These are a sign the column was treated as a number. Re-export from the source system rather than trying to repair them, because digits at the end may already be lost.

  6. Count the matches every time

    After any join, count how many rows found a partner. If last month it was nearly all of them and this month it is two thirds, the files changed, not the business. That one number catches most ID problems the day they appear.

Where the drift creeps in

It helps to know the moments an ID is most at risk. In Larkspur’s case it was a re-save, but there are a few usual suspects.

  1. Source system00417
  2. Export to a filestill 00417
  3. zeros dropped here
  4. Opened and re-savedbecomes 417
  5. Joined to ordersno match
The export is usually fine. The risk is the moment someone opens the file and saves it again.

Copy and paste between sheets, merging two lists by hand and exporting from an older version of a tool are the other common moments. None of them are anyone’s fault. They are just the places to look first.

Why it is worth the ten minutes

A broken match is quiet. Nothing errors, nothing turns red. The report simply runs on fewer rows than it should, and the totals look plausible. Priya only noticed because she knew roughly what the regional numbers ought to be. A newer colleague might not have.

Once she set the customer list to keep IDs as text, and added a small cleanup step that strips prefixes and trims spaces before the join, the missing third came back. The hero chart at the top of this page shows the same idea on invented numbers: the business did not change, only the number of orders that could find their customer.

How Storek helps

Storek compares the values in your files when they arrive, so it notices when C-00417, 00417 and 417 are almost certainly the same customer. When the pattern is clear across the whole column, it lines them up and tells you what it did. When it is not sure, for example when two different prefixes share the same numbers, it asks you rather than guessing. You still benefit from tidy IDs, and you do not have to catch every slip yourself.

AccuracyData loadingSemantic layer

FAQ

Questions, answered.

Why do leading zeros disappear in the first place?

When a file is opened in a spreadsheet, a column of digits is usually treated as a number, and numbers have no leading zeros. The value 00123 becomes 123 the moment the file is opened, and if it is saved again, the zeros are gone for good.

Should I add the zeros back or strip them everywhere?

Either works, as long as every file ends up the same. Stripping is often easier because you cannot always tell how many zeros a value is supposed to have. What matters is that you pick one form and write it down.

Is it safe to remove a prefix like C- from customer IDs?

Only if the prefix means the same thing on every row. If one system uses C- for customers and S- for suppliers, and both have a number 123, removing the prefix would merge two different things. Check that first.

How do I know if my IDs are the problem?

Count how many rows in one file find a partner in the other. If a large share of obvious matches come back empty, put a few unmatched IDs side by side with their nearest lookalike. A missing zero or extra prefix usually shows up within a minute.

Book a demo

See your own data, delivered.

30 minutes. Your data or our sample. No slide deck. Pick a time straight after the form.