Skip to content

Workflows / Worked example

Compare & reconcile

Compare two order exports without silently merging records

Find new, removed, changed, and repeated order keys using two fictional exports, with a complete expected-result table.

The AI ExplainerPublished November 4, 20263 min readExample & verification method

Define what one row represents

Before comparing two lists, decide whether each row is an order, an item within an order, or an event in an order's history. A single order_id works only if each file contains at most one record per order. The two comparison samples are order-level snapshots, with one deliberately repeated key to show why a tool should stop short of merging it.

Work with the example

Snapshot A ↓Snapshot B ↓

All records are fictional. Import CSV identifier columns as Text. Quoted CSV fields do not define spreadsheet column types.

Open the order-list comparison tool, load the samples, and use order_id as the key. Column names must match across the files; their order can differ.

Reconcile all six distinct keys

Order keyExpected resultWhat to review
000101UnchangedShipped and RM34.60 in both files.
000102ChangedStatus changes from Pending to Shipped.
000103Only in AAbsent from B. Absence alone does not prove cancellation.
000104UnchangedCancelled and RM70.00 in both files.
000105Repeated key — reviewTwo rows in A and one in B. No automatic choice is made.
000106Only in BA newly appearing key.

The result counts are two unchanged, one changed, one only in A, one only in B, and one repeated key. File A has six records, file B has five, and the union contains six distinct keys. These numbers measure different things and should not be substituted for each other.

Understand the matching rules

The comparison is exact and case-sensitive. Spaces remain significant: 000101 and 000101 are different keys. Values such as 20.0 and 20.00 count as different text even when they represent the same amount. Normalize only after agreeing what differences are harmless for your source.

If a key repeats in either file, the tool reports the group for review, including its row counts. It does not pick the first record, add the amounts, or remove a row. On a line-item export, create a documented composite key such as an order ID plus a line ID, and check that the separator cannot appear in either part. Duplicate composite keys still need investigation.

Use the report as a review queue

The download is a review report, not an updated order ledger. It includes the key, classification, counts, and the first record from each side for context. Repeated groups may contain additional records that must be inspected in the original files. The screen shows at most 150 result rows; the download includes every result within the input limits.

Do not interpret “Only in B” as a sale or “Only in A” as a deletion until you understand the export filters and dates. Snapshots made at different times may include legitimate status changes. Keep source snapshots and the export settings with your reconciliation notes.

Sources & further reading

The sample data and worked calculations are original instructional examples. Spreadsheet menus and supported features depend on your installed version. See the verification method for the checks performed.