AI basics & verificationPractical AI workflows

Merge same-name staff lists by ID: a complete matching and review exercise

Use a verified shared staff ID to link these lists; identical names cannot establish identity. This fictional four-source exercise provides both input CSVs, a full-join procedure and an answer ledger. The correct result has three output rows, but a name-based mistake also has three: review the source links before accepting a count.

Woman working on a laptop with spreadsheet data
Illustrative photo: Rodrigo Rodrigues | WOLF Λ R T · Unsplash License

What changed: Added bilingual input tables, a full-join workflow, a four-source review ledger and a name-join fault with the same row count.

The workflow at a glance

A full join on staff_id should link R01–T01, retain R02 without a training match and retain T02 with its missing ID unresolved. Trace R01, R02, T01 and T02 once each. Three output rows are neither three verified people nor proof that R02 did not attend.

Establish where identity evidence comes from

Editorial advice: define the key before merging. Does a staff ID represent the same identity in both systems? Can it be reused? Do leading zeros matter? Shared names, similar departments and matching row positions do not answer these questions. Specify allowed normalization separately rather than letting AI remove characters or invent identifiers.

RFC 8259 distinguishes JSON strings from numbers and recommends unique object member names. That is a representation rule, not identity verification. Using a person’s name as an object key makes shared names difficult to retain. An array of records with string identifiers can represent both entries. Review the CSV and JSON identifier checks when converting.

Four inputs require three different decisions

The directory, identifiers and training entries below are original fictional examples without real personal data. Assume an authorized owner has confirmed that staff_id means the same thing in both systems. Missing IDs cannot be inferred from names. R01 and R02 share a name but have distinct IDs; T01 has an abbreviated name and the same ID as R01.

Fictional input: retain every source record
Source rowstaff_idNameInformation
Directory R01E007Lin ChenDesign
Directory R02E021Lin ChenOperations
Training T01E007L. ChenIntro course
Training T02MissingLin ChenIntro course

Expected decisions: link T01 to R01, keep R02 without a training match, and mark T02 unresolved. This does not establish absence from training or identify which Lin Chen T02 belongs to.

Download both original tables before joining

The exercise ZIP provides directory.en.csv and training.en.csv, Chinese counterparts, expected-links.csv and review-ledger.csv. Start with the two inputs for one language only. The answer ledger is editorial reference material; it is not another input table or generated AI output.

Keep source_row as evidence. Both inputs use the same column names but hold different kinds of record. Do not click “Merge all original tables”: that appends rows and cannot establish a staff-to-training relationship.

Directory CSV

source_row,staff_id,name,department
R01,E007,Lin Chen,Design
R02,E021,Lin Chen,Operations
Two distinct IDs intentionally share a name.

Training CSV

source_row,staff_id,name,course
T01,E007,L. Chen,Intro
T02,,Lin Chen,Intro
T02 has a genuinely blank staff_id; do not fill it from the name.

Request decisions instead of only a shorter list

Supply the following rule with all four rows to an authorized AI service. Use fictional data for a pilot and follow organizational rules for real lists. A prompt describes constraints without guaranteeing compliance, so review the output row by row.

  1. Save the original four inputs with stable source-row labels, preserving missing values and names.
  2. Confirm the identifier systems and allowed normalization manually. This example permits exact ID matching only.
  3. Ask for per-source decisions and reasons, separating missing or conflicting identifiers as unresolved.
  4. Check that T01 is linked because of E007, not name similarity, and that T02 is not silently assigned.

Matching-decision prompt

Treat each source row as evidence. Match records only by the supplied staff_id, whose shared meaning has been confirmed. Keep IDs as strings. Do not match by name, row order or department.
Return: source row IDs, decision, matched row IDs, reason, unresolved question.
Allowed decisions: matched, unmatched, unresolved.
Missing or conflicting IDs must remain unresolved. Keep every source row traceable.
For R01/R02/T01/T02, explain which rows can be linked and which require confirmation.
Original template. Include the fictional source fields, not just the four row labels.

Run the full join and inspect source-side fields

Open Data cleaning and analysis. This operation compares the two selected original tables, not an accepted cleaning result. The current join trims surrounding whitespace from keys; these fixtures contain none. If such trimming is forbidden by your identifier rules, use a matching route that preserves those distinctions.

  1. Import directory.en.csv and training.en.csv together, then expand “Join and compare (original tables)”. Select the directory as Left table and training as Right table; verify the file names rather than trusting import order.
  2. Set Comparison key to staff_id and Join type to Full join. Click Join by key. Keep both source_row columns, both staff_id columns and both original names.
  3. Expect three rows: R01–T01, R02–blank and blank–T02. A left join would omit the unmatched right-side T02; if you choose that route, retain its separate unresolved ledger.
  4. Download CSV and reopen it. Read source-side headers to distinguish directory source_row from training source_row. Reconcile against expected-links.csv by source pairs, without relying on output row order.
Three result rows account for four sources
Directory sourceTraining sourceDecision
R01T01E007 matched; retain both names
R02blankNo verified match in this input
blankT02Missing ID; unresolved

The tool performs key matching. It does not verify the shared ID system, decide attendance or automatically create the review decision ledger.

Check source coverage rather than plausible headcounts

Editorial acceptance rubric for this example
RecordSupported handlingReject this output
R01 and T01Retain both sources and link by E007Discard the alias or training source
R02Keep independent with no training matchMerge into R01 because of the name
T02Explain the missing ID and retain unresolved statusAssign E007 or E021 by name

No match is not evidence of absence

Unsupported inference

R02 has no matched training row, so report “this person did not attend.”

Evidence-bounded conclusion

Report “no verifiable training match was found in this input.”

Incomplete data, missing identifiers and different source scopes can all prevent a match. The second statement describes evidence without creating an absence fact.

Three rows can still be three wrong relationships

In a fresh run, deliberately change the key from staff_id to name while retaining Full join. R01 and R02 now both match T02 because the names are equal; T01 remains unmatched because L. Chen differs. The result still contains three rows. This is a constructed counterexample, not a model benchmark.

Compare source pairs: the correct result has R01–T01 once, whereas the fault repeats T02 twice. Reject the name-based output, restore staff_id, rerun and download again. Do not repair by deleting one repeated-name row: that would discard an independent staff ID.

Check links and coverage, not just count
CheckID joinName join fault
Output rows33
R01 paired withT01T02
T02 appearances12
Verified complete headcountunknownunknown

Handle missing IDs, aliases and conflicts differently

Resolve a missing ID with an authorized owner or source system rather than asking the model to guess. For the same ID with conflicting fields, preserve both values and versions. Longer text is not necessarily newer. Different identifier systems require a verified mapping before cross-system matching.

Do not turn empty fields into zero or “none.” The missing-versus-zero extraction guide distinguishes unavailable information, unresolved status and explicit absence. A name can help a human find candidates without automatically becoming merge evidence.

Deliver matches that can return to their inputs

Keep original sources, rules, output and manual confirmation records. Before calculating totals, define whether you are counting people, source rows or confirmed matches. Four input rows do not imply four people, and an unresolved entry does not establish a complete headcount. After a small sample passes, review duplicate IDs and coverage in the real material.

Conditions for this example

  • All four source rows remain traceable.
  • Same-name E007 and E021 remain distinct.
  • T01 has identifier evidence; T02 remains unresolved.
  • No match, attendance absence and final headcounts are separate claims.

Common questions

Can identical names be merged directly?

A name alone does not establish identity. The same-name entries have different IDs in this example and stay separate pending stable-identifier or verified mapping evidence.

Do different abbreviations prove two people?

No. In a confirmed shared identifier system, an exact stable-ID match can link records while retaining original names and sources.

Does no training match prove nonattendance?

No. It describes the available input and matching rule. Missing IDs, different scope or incomplete records can all prevent a match.

Further reading & sources

Put the guide into practice

Open the relevant tool, preview the result and check your exported file.

Newer articles on this topic

Continue with a newer article that refers to this guide or explainer.

Related articles