From a messy client Excel to a clean base: detection, column recognition, validation, normalisation.
Headers with trailing spaces, a line break, inconsistent labels, one corrupted date column.
| Header received | Problem |
|---|---|
'Notification date ' | trailing space |
'Loss\n Date' | line break inside the header |
'Payment Amount ' | trailing space + floats to round |
'Covid claims ' | values covid vs cvid (typo) |
'Loan Type' | 3 spellings: Car loan / Car Loan / Car Loan |
'Effective date' | every value = 1905-07-11 (corrupted Excel serial) |
Each header is cleaned then matched to the target schema by similarity. A confidence score, to be confirmed by the client.
| Source column | Target field | Confidence | |
|---|---|---|---|
Notification date | β | notification_date | π’ sure |
Loss Date | β | loss_date | π’ sure |
Payment Amount | β | payment_amount | π’ sure |
Loss Type | β | loss_type | π’ sure |
Covid claims | β | covid_flag | π’ sure |
Loan Type | β | loan_type | π’ sure |
Effective date | β | effective_date | π’ sure |
Amounts are read whatever the separators (comma/dot, symbols). Out-of-range dates are flagged, not imported silently.
| Field | Verdict |
|---|---|
payment_amount | 19/19 recognised |
notification_date, loss_date | 19/19 recognised |
effective_date | β οΈ 19/19 = 1905-07-11 β suspicious dates (Excel serial), to check before import |
We group the spellings of a same label and propose a canonical one. The client keeps control: they know their labels best.
| Field | Spellings received | Proposed canonical | |
|---|---|---|---|
loan_type | Car loan, Car Loan , Car Loan | β | Car Loan case/spacing |
covid_flag | covid (18), cvid (1) | β | covid close spelling |
loss_type | Death Any Cause (17), DAC (1) | β | Death Any Cause acronym |
Typed columns, numeric amounts, unified labels, suspicious dates flagged. Ready for Excel/CSV export and for the SQL agent.
| notification_date | loss_date | payment_amount | loss_type | covid_flag | loan_type |
|---|---|---|---|---|---|
| 2022-01-14 | 2021-11-27 | 19,714.14 | Death Any Cause | covid | Car Loan |
| 2021-07-05 | 2021-06-15 | 21,235.68 | Death Any Cause | covid | Car Loan |
| 2021-03-16 | 2021-03-04 | 41,969.60 | Death Any Cause | covid | Personal Loan |
(3 of the 19 rows, after cleaning.)