Customer contact deduplication
Owner: Fernwick Service manager.
Why: Hand a deduplicated contact list to the service desk.
Data: Fictional branch contacts with case differences, padding and missing email.
Done: ContactID, Customer, Email and Orders, one record per normalized email, sorted by Orders descending then Email.
Fernwick Service combines contact rows collected by two branches. The same email can appear with different case or surrounding spaces, and a row without an email can't be used for the requested contact list. The service manager needs one record per normalized email, ordered by completed orders so the outreach desk has a stable handoff.
Keep the first source contact when two records share a normalized email. This is a stated rule for this project, not a general rule for resolving conflicting customer details. You should agree on a conflict policy before using it in a workplace system. Generate a handoff identifier after sorting, then select the fields that the desk needs. The final output is a checked contact dataset; the local simulator doesn't send messages or update customer records.
input: {"source":"main"}
formula: {"field":"Email","expression":"LowerCase(Trim([Email]))","type":"V_WString"}
Worked example: Trim and case normalization happen before duplicate comparison. A null stays missing.