Before replacing a restaurant sales report, account for what changed in its underlying export. This inspector compares two files that you choose or paste into this tab. It keeps identifiers as text, separates unique-key changes from ambiguous keys, and builds an exact signed amount bridge when the inputs support one. The examples below are fictional teaching records, not downloads from a restaurant platform.
Prepare two files that can answer the same question
Use exports with the same row meaning, the same columns and a comparable reporting scope. Write down the source, download time, filters, time zone and amount definition outside the tool. An order-level file cannot be compared directly with an item-level file merely because both contain an order ID. A later download can include a different window or a different settlement basis; the tool cannot infer those facts from its filename.
- Paste or select the before and after CSV files. Both require a header. Choose their shared delimiter explicitly.
- Enter the exact key column names as a JSON array. For a single location,
["order_id"]may be sufficient; for a multi-location export,["outlet_id","order_id"]may be necessary. Confirm that this tuple identifies one intended record. - Choose an amount column already expressed in whole minor units and declare its one currency. For this example, INR 100.00 is represented as
10000. The tool does not multiply unknown amounts by 100. - Read the conflict and missing-key witnesses before using the bridge. Keep the original files and download the current result JSON if you need a review record.
Column names and key values are exact strings. 001, 1 and 001 are three different keys here. This is deliberate: removing a space or leading zero without a source rule can merge separate records. Microsoft documents Excel text-import options and numeric precision limits; preserve identifier columns as text when preparing your comparison. Read Microsoft's identifier-preservation guidance.
- Same row meaning, schema and units? If unknown, establish them before comparing.
- Missing or repeated exact keys? Inspect those records; do not select a preferred row automatically.
- Unique keys on both sides? Classify their membership and exact column differences.
- Every key and amount valid? Reconcile the complete amount bridge; otherwise retain a partial diagnostic.
- Use source evidence to decide which file, if either, should replace a report.
A refund makes the subtraction easy to get wrong
Load the fictional before CSV and fictional after CSV. Their header is order_id,amount_minor,note. The complete answer is available as handwritten expected-answer JSON; the fixture README text records the assumptions.
| Key | Before | After | Classification | Effect on after minus before |
|---|---|---|---|---|
| 001 | 10000 | 10000 | Unchanged | 0 |
| 002 | 20000 | 18000 | Changed | −2000 |
| 003 | −1000 | Absent | Removed | +1000 |
| 004 | Absent | 5000 | Added | +5000 |
Before total: 10000 + 20000 − 1000 = 29000. After total: 10000 + 18000 + 5000 = 33000. The net is 33000 − 29000 = 4000. Independently, the membership bridge is 5000 − (−1000) + (18000 − 20000) = 4000. Removing a negative refund increases this file total. That arithmetic does not establish why the refund disappeared.
The general identity is after − before = added amounts − removed amounts + retained-key amount changes. A non-money note change still makes a row “changed”; its amount contribution may be zero. The inspector compares field text, so 100 and 0100 are a textual change even though their integer amount difference is zero. Header order and row order alone do not create changes.
Read withheld results as evidence limits
Now load the fictional duplicate-key CSV as the after file. Key 002 occurs twice, for 18000 and 19000. The complete bridge becomes N/A. Both rows remain visible in the conflict witness; no “latest”, first, maximum or deduplicated amount is chosen. The raw after total is 52000, because that sum includes both physical records. A raw difference of 23000 can be arithmetically correct while still being unsuitable as a unique-order explanation.
Blank key components are unaligned records. Repeated keys, including identical repeated rows, are conflicts because the intended row grain is unknown. A zero amount is a valid known zero; a blank amount, decimal, currency symbol, exponent or grouping separator is invalid for this integer-unit tool. Negative amounts are allowed for explicitly signed data. Invalid amounts withhold the affected raw total and the complete bridge. Oversized values or totals are rejected instead of rounded. Header-only files represent zero data rows; incompatible header sets and ragged records require correction before a comparison is accepted.
The tables retain complete supported populations in the current result; the screen initially shows at most 100 rows per table. Recheck total row counts when reviewing a large comparison. JSON preserves quoted field strings and the current configuration; it is a diagnostic record, not a replacement transaction export.
When to stop and investigate the source
An added key means present only in the after file. It does not prove a new order. A removed key does not prove cancellation. Even an unchanged file can be incomplete. Mixed currencies, different tax or refund conventions, overlapping source windows and changed export granularity require evidence outside this model. Use the export-cleaning guide for a documented transformation process and the schema migration rehearsal when column meaning or units actually change.
CSV quoting is parsed structurally: embedded delimiters and newlines inside quoted fields stay in their fields. RFC 4180 describes common comma-separated conventions and is informational. This tool also accepts declared semicolon or tab separators and CR/LF line endings. Use CSV preflight for structural diagnosis. Neither parsing nor a balanced bridge establishes the authority of a file.
