Lompat ke konten

Pelajaran 11 ยท Blending and Joining

Find Replace and Fuzzy Match

Map messy values with the Alteryx Find Replace tool, match near-duplicates with Fuzzy Match and Make Group, tune thresholds and review results safely.

Sometimes a join cannot work because the values are not exactly equal. "Acme Ltd", "ACME Limited" and "Acme Ltd." may be one company. Designer offers Find Replace for controlled mapping and Fuzzy Match for similarity matching.

Fuzzy results are guesses. This lesson shows how to use them and how to check them.

Find Replace

The Find Replace tool has two inputs: the F (find) stream, your main data, and the R (replace) stream, a lookup table. For each row, the tool searches the value of one field in F for values from R.

You can configure it to match the entire field, the beginning of the field or any part of it, and then:

  • replace the found text with the lookup value, or
  • append fields from the matching lookup row.

This is ideal for a mapping table, such as turning many spellings of a country into one standard name. Keep that table in a file that the business can edit, so changes do not require editing the workflow.

Python Stand-in: a mapping table for country names

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The list of unmapped values is important. Review it after every run and add new entries.

When matching part of a field, short search strings can match more than you want. A search for "us" would also hit "Australia". Test the tool on a sample that contains such near misses.

Fuzzy Match

Fuzzy Match compares records using similarity, not equality. It needs a unique ID field on each record (add one with Record ID if needed). You configure:

  • The mode. Purge compares all records with each other, to find duplicates. Merge compares only records from different sources, so it needs a field that identifies the source, and it does not find duplicates within one source.
  • Which fields to compare, and a matching style suited to the data, such as names, addresses or custom settings.
  • A match threshold: how similar two records must be.

The output lists pairs of matching IDs and, if you choose, scores. To group all related records together, connect the pairs to the Make Group tool, which assigns a group key to linked records.

Names and options differ between versions. Check the help for your matching style.

Thresholds are trade-offs

A low threshold finds more true matches but also more false ones. A high threshold avoids false matches but misses real ones. There is no universal correct number. Choose it with labeled examples from your own data.

Python Stand-in: similarity scores and a threshold

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

At the lower threshold, "Apex Ltd" is probably pulled in even though it is a different company. Short strings and common words (Ltd, Inc, Street) inflate similarity. Removing such words and standardizing text first usually improves matches more than moving the threshold.

Make Group, and chains

Grouping connects chains: if A matches B and B matches C, all three share a group, even when A and C are not very similar. Large groups often mean the threshold is too low. Check the biggest groups first.

Python Stand-in: grouping linked pairs

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A safe matching process

  1. Clean and standardize first.
  2. Block the data: compare only records that share something, such as a country. This reduces false matches and run time.
  3. Run the match and sort results by score.
  4. Review a sample of high, borderline and low scores by hand.
  5. Auto-accept only clear matches; send borderline ones to a person.
  6. Keep an audit trail with the original values, the score and the decision.

Never merge customer, patient or financial records automatically on a fuzzy score alone. A wrong merge can expose one person's data to another and is hard to undo.

Measuring match quality

To know whether your settings are good, label a sample by hand. Take a set of candidate pairs and mark each one as "same" or "different". Then compare the tool's decisions with your labels and count two kinds of error:

Error Meaning Typical fix
False match Two different things were matched Raise the threshold or compare more fields
Missed match The same thing was not matched Standardize better or lower the threshold

Which error is worse depends on the task. For a mailing list, a missed duplicate means a second letter. For medical or banking records, a false match can be very serious. Choose settings according to that cost, write the decision down and repeat the measurement when the data changes.

Keeping the mapping healthy

A mapping table grows over time. Check that no search value appears twice with different replacements, give each row an owner or a date and review old entries occasionally. Treat the table like code: a wrong line changes results in every workflow that reads it.

Practice task

Write down twenty invented company names with realistic variations: different capitalization, punctuation, legal suffixes and one or two typing errors. Add a few names that look alike but belong to different companies. Mark by hand which records belong together.

First, standardize the names and see how many groups become exact matches. Only then try similarity matching, either with Fuzzy Match or with the stand-in. Compare the result with your hand labels at two thresholds. Count the false matches and the missed matches each time, and write one sentence that explains which threshold you would choose and why.

Common mistakes

  • Skipping the unique ID, or reusing IDs between two datasets.
  • Tuning the threshold until the results "look good" without a labeled sample.
  • Overwriting source values so the original spelling is lost.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the Fuzzy Match tool require for each record?

    The tool reports matches as pairs of record IDs.
  2. 2. What happens when you lower the match threshold?

    A looser threshold finds more true and more false matches.
  3. 3. Which tool groups linked pairs into one set?

    Make Group assigns a shared key to connected records.
  4. 4. What should you do with borderline matches?

    Borderline cases need human judgment and an audit trail.

Summary

  • Find Replace maps values with a lookup table; review unmapped ones.
  • Fuzzy Match scores similarity and needs a unique ID.
  • Standardize and block data before matching, then tune thresholds with labeled samples.
  • Review borderline results and keep an audit trail.

Next: Text To Columns and RegEx

Progres Anda disimpan di browser ini. Tidak perlu akun.