What is fuzzy logic, Matching and duplicate rules?

Fuzzy logic is a way to model logical reasoning where the truth of a statement is not a binary true or false, but rather it is with the degree of truth that ranges from 0, which is absolutely false, to 1, which is absolutely true.

When there is uncertainty in data and the search criteria, the Fuzzy logic option helps to filter the available best match account, as it can incorporate all intermediate values between True and False.

📘

When to use Fuzzy matching?

Fuzzy Matching (also called Approximate String Matching) is a technique that helps identify two elements of text, strings, or entries that are approximately similar but are not exactly the same.

Salesforce Matching methods

(Source Courtesy: https://www.salesforceben.com/what-are-fuzzy-matches-in-salesforce-deduplication/)

Exact Match

For this match, as the name suggests, the fields in the two records should be the exact same. The match is either True or False

Record A

Record B

Method

Evaluation

John Doe

John Doe

Exact

True

Jon Doe

Jon Doe

Exact

False

In the solutions, which have exact match with random order, the words match exactly but not in the same order.

Record A

Record B

Method

Evaluation

John Doe

Doe John

Exact (Random Order)

True

Fuzzy Match

Fuzzy match will return a match where the fields are more or less similar, and the most used algorithm to find this is Edit Distance. This algorithm holds good and better for longer strings rather than shorter ones.

Edit distance is the number of single character edits (insert, delete or change) needed to change one string into another.

Jon Doe <> John Doe has an edit distance of 1. In this case only the insertion of the letter ‘h’ in John will make the two strings equal.

The goal of matching is to return similar results (with the same meaning). So that suggests that only using edit distance for this goal is not ideal, especially for shorter strings (names, words). Consider the following:

Record A

Record B

Method

Edit Distance

Intended meaning

Cat

Hat

Fuzzy

1

Very Different

Elephant

Elephont

Fuzzy

1

Same

Shorter strings often have entirely different meanings with one or two edits. The longer the string, the less the impact of an edit on the meaning. To combat this problem, most deduplication solutions use a matching score based on multiple fields and a threshold to determine duplicate records.

Record A

Record B

Method

Edit Distance

Max Edit Distance

Score

Cat

Hat

Fuzzy

1

3

66.6%

Elephant

Elephont

Fuzzy

1

8

87.5%

So longer the string, higher the matching score. This is the basic fuzzy logic used by Salesforce to compare two records. To know more in detail about Salesforce Fuzzy logic click here

Matching rules and Duplicate rules

Matching Rules
A matching rule applies criteria to determine how closely a field on a new or edited record matches the same field on an existing record. Standard matching rules include predefined criteria. When you create a custom matching rule, you define the criteria.

Duplicate Rules
A duplicate rule defines what happens when a user views a record with duplicates or starts creating a duplicate record. Salesforce provides standard duplicate rules for business and person accounts, contacts, and leads. Customized duplicate rules can also be created.

Difference between Matching Rules and Duplicate Rules

Matching Rules will identify ‘what field’ and ‘how’ to match. For example, ‘Email Field, Exact Match’ or ‘Account Name, Fuzzy Match’ They don’t do anything on their own.
Duplicate Rules will use those Matching Rules to control ‘when’ and ‘where’ to find duplicates. For example, “Use Account Name, Fuzzy Match to find duplicates on the Account object upon creation” or “Use Email, Exact Match, to find duplicates on Leads and Contacts, upon create and edit.”

An overview of these logic and rules will help in understanding how to formulate better rules to find the best match account with fuzzy logic. The below link shows

How to find best match account with fuzzy logic?

Below screenshot of different case studies of BMA with the fuzzy logic results for the Account name Athena Health Limited gives an insight about how BMA results are fetched.

14031403 14111411