Data reconciliation from source to warehouse
Compare both results
- Overall counts and amounts
- Counts and amounts by category
- Record keys and selected fields
Matching row counts and grand totals provide limited assurance that a warehouse load is correct. Records can move between reporting categories while the overall count and amount stay the same. Data reconciliation should therefore test the breakdowns people use to make decisions, then compare individual records where the cause of a difference is unclear.
For a sales report used to compare channels, reconcile paid-order counts and amounts by channel before publishing the split. Use the same reporting window, eligible orders and category rules on both sides. Check individual orders when a difference appears or when a field needs stronger assurance than grouped totals can provide.
What each reconciliation check establishes
Data reconciliation compares information across systems and resolves discrepancies. In a warehouse load, the comparison is between the result the source data should produce under agreed business rules and the result the warehouse actually contains. IBM's overview of data reconciliation describes how these checks fit around data integration and transformation.
| Check | What a match establishes | What can still differ |
|---|---|---|
| Overall count and amount | The compared load has the same number of rows and the same total amount. | Individual records or amounts may differ. Records can be assigned to the wrong categories. |
| Count and amount by decision-relevant category | The compared measures agree for each category, such as sales channel or region. | Differences within a category can offset each other. Fields outside the check can still differ. |
| Record keys and selected fields | The same unique records are present and the selected fields match their expected values. | Fields outside the comparison and defects in shared source data or approved business rules remain outside its scope. |
Snowflake's migration validation documentation distinguishes aggregate metrics from row and field comparisons. It also provides for expected transformations, such as deliberate remapping of a status value. The distinction applies to the design of a warehouse check even when a team uses different tooling. Snowflake's data validation documentation
Define what should match before running the check
Compare the source extract for a completed load with the warehouse output from that same load. Record the batch identifier, reporting window, time zone, filters and currency. Define what each row represents. If the comparison is at order level, each side needs one row for every eligible order. Validate that the order identifier is present and unique before attempting to match individual records.
Where the warehouse deliberately changes a value, calculate the expected result from the approved transformation. To check a channel mapping, derive the expected channel independently from the approved mapping and the raw source code. Reusing the transformation under test on both sides can reproduce the same error in both results. The reporting owner should confirm the business rules. The pipeline owner should identify the source extract and warehouse load those rules apply to. GrowthGear data engineering
Use grouped checks to locate a difference
Count orders and sum amounts separately by channel in the expected source result and the warehouse output. Compare all channels present on either side, including blank or unexpected categories. Record the signed difference as warehouse minus expected source. A shortfall in one channel and an equal surplus in another are consistent with misclassification. The grouped result alone leaves open other explanations, including offsetting missing and extra records.
After checking keys for duplicates and missing values, compare the identifier sets in both directions. Then compare the expected and actual channel and amount for shared identifiers. Include orders assigned to an affected channel on either side so a moved order remains in scope. If an order appears on both sides with the same amount and different channel, check its raw source code against the approved mapping and trace the value through the warehouse transformation.
In a published AWS implementation, initial row-count comparisons left the team without coverage for individual rows or fields. The implementation added cell-level comparisons to address that specific gap. AWS's reconciliation implementation
Define when a failed check should hold a report
Agree on the response before automating the test. Hold an affected breakdown when a discrepancy can change the decision the report supports. Give the reporting owner the batch ID, affected measures and categories, differences and the status of the investigation. If the difference comes from an inconsistent cutoff, align the comparison. If it comes from a faulty mapping, correct the mapping and rerun the affected load through the approved reload process.
After the correction, repeat the grouped check and the record-level comparison that identified the discrepancy. Record the fix and retest results with the batch so the reporting owner can confirm what was resolved. For the next reporting cycle, select a breakdown the business acts on and add its order count and amount checks to the load. GrowthGear analytics and reporting