The concept Healthy systems, wrong data
A system can be up, its APIs can answer and its queries can finish, and the business process can still be wrong, because the data being exchanged is incomplete, inconsistent, duplicated or stale.
| Problem | Example at Apex |
|---|---|
| Missing values | A required loan reference is empty |
| Invalid values | A negative amount where the rules do not allow one |
| Duplicate records | One payment appears twice as two postings |
| Inconsistent identifiers | Provider IDs do not map reliably to internal payment IDs |
| Wrong timestamps | A local time read as UTC |
| Inconsistent statuses | CAPTURED, COMPLETED and POSTED used as if they meant the same |
| Stale data | A report shows a loan balance not yet updated |
| Wrong relationships | A payment linked to the wrong loan |
Lineage Follow one value from source to report
Data lineage describes where a value started, how it was transformed, where it moved and where it was used. For a payment amount, ask: which system created it, was it transformed, was the currency changed, was rounding applied, where was it stored, who uses it, and can it be traced back to its source?
For each hop, also record the identifiers that let you prove the path later: the event ID, the version of the transformation that ran, when it was processed, and which system and team are responsible. Without the version, you cannot tell whether a wrong value came from today's code or last month's. Here is TX1001 on November 18:
| Hop | Event or request ID | Transformation and version | Processed at | Responsible |
|---|---|---|---|---|
| Payment provider | EVT100 | None: source record TX1001, amount 500.00 | 09:00:01 | Provider A |
| Integration | EVT100 | provider-a-mapper v2.3: transactionId becomes provider_txn_id | 09:00:02 | Integration service, IT integration team |
| Loan servicing | REQ-7101 | servicing-api v5.1: amount stored as a decimal with two places | 09:00:03 | Loan servicing team |
| Reconciliation | Run R-1119-0600 | Matching rules v14 | 06:00 the next day | Finance systems team |
| Reporting | Daily batch D-1119 | Daily totals v3 | 07:00 the next day | Reporting team |
Lineage is something you can query. Join what each provider sent to the payment rows it became and to the loan they point at. Every hop that changed or lost a value shows up as a row that fails the check. Here is the six-row sample from Lesson 03, next to the four provider records it came from:
sqlFollow every provider record to its payment rows and loan
SELECT
r.transaction_id,
r.loan_reference AS sent_loan,
p.payment_id,
p.loan_id AS stored_loan,
CASE
WHEN p.payment_id IS NULL THEN 'no payment row'
WHEN p.amount <> r.amount THEN 'amount changed'
WHEN p.loan_id IS NULL THEN 'loan lost in mapping'
WHEN l.loan_id IS NULL THEN 'loan not found'
ELSE 'ok'
END AS lineage_check
FROM provider_records AS r
LEFT JOIN payments AS p
ON p.provider_id = r.provider_id
AND p.provider_transaction_id = r.transaction_id
LEFT JOIN loans AS l
ON l.loan_id = p.loan_id
ORDER BY r.transaction_id, p.payment_id;Result on the sample
transaction_id sent_loan payment_id stored_loan lineage_check
-------------- --------- ---------- ----------- --------------------
TX1001 LN500 PM9001 LN500 ok
TX1001 LN500 PM9002 LN500 ok
TX1002 LN501 PM9003 LN501 ok
TX2001 LN502 PM9004 LN502 ok
TX2001 LN502 PM9005 LN502 ok
TX2002 LN503 PM9006 loan lost in mappingReal output from SQLite 3.54 on a fictional sample (tools/fde/apex_lineage.sql), November 22, 2026. The payments rows are the Lesson 03 sample.
The query moves the question. PM9006 has no loan, but the provider did send LN503, and LN503 exists. So the value was lost between the provider and the payments table, in the mapping step, not at the source. The next question goes to the team that owns that mapping: which version ran for TX2002, and what did it do with the loan reference? The check also shows what it cannot see: TX2001 passes, because both of its rows are consistent with what was sent. Whether it was posted twice is a ledger question, not a lineage one.
Timing Not every difference is a defect
Systems update at different times: the provider records a payment, the integration service publishes an event, loan servicing processes it, and reporting catches up later. For a while the systems disagree even though everything works as designed. Understand the expected processing delay, data freshness requirements, eventual consistency, reconciliation windows, which system is authoritative, and the business acceptance criteria before you call a difference a bug.
Eventual consistency is acceptable only within an agreed window. At Apex, for example, the agreement might be that loan servicing reflects a payment within 15 minutes of capture, and reconciliation is complete by 6:00 a.m. the next day. A difference inside that window is expected. The same difference an hour later, or the next afternoon, is a defect. If nobody has agreed a window, that is a finding in itself: ask the business owner to set one.
Systematic checks Seven dimensions of data quality
| Dimension | Question to ask |
|---|---|
| Completeness | Are all required fields filled in? |
| Accuracy | Does the value represent the correct business fact? |
| Consistency | Do related systems agree where they should? |
| Uniqueness | Are there duplicate logical records? |
| Validity | Does the value follow the accepted rules? |
| Timeliness | Is the information available when it is needed? |
| Referential integrity | Does the record link to the correct entity? |
Write the results as a data-quality report: dataset name, sample period, records examined, validation rules, failed record counts, failure categories, business impact, example records with sensitive data protected, known limitations and recommended corrections.
Practice Score a sample
Practical exercise
Seven dimensions, six rows
Look again at the six-row payments sample from Lesson 03 (PM9001 to PM9006).
- Check it against all seven dimensions.
- Write one finding per problem you find, with its business impact.
Show sample findings
- Completeness: PM9006 has no loan_id. Impact: the payment cannot be posted to any loan. The lineage query shows the provider sent LN503, so the value was lost in mapping, not at the source.
- Uniqueness: TX2001 has two POSTED rows (PM9004 and PM9005, 28 seconds apart). That is a possible duplicate, not proof of a double posting. Check the loan servicing ledger history for LN502 and the business rules: did the balance drop twice, or is the second row a status record for the same posting? Impact if confirmed: a $450 double credit to LN502.
- Consistency: TX1001 has AUTHORIZED and POSTED rows; confirm the business allows one row per status.
- Timeliness and accuracy: cannot be judged from this sample alone; request settlement data and timestamps from other systems.
3 questions
Check your understanding
What you can do now
- Recognize common data-quality problems.
- Trace a value through its lineage.
- Tell expected delays apart from real defects.
- Check data against seven dimensions and write a data-quality report.