Thursday, July 9, 2020

Functions can be used in fuzzy match

Notes taken from PharmSUG seminar

SOUNDEX (Sound Alike)
Ignore case, embedded blanks and punctuations; works best with English-sounding names;

Example:
WHERE varx = * "Michael";


SPEDIS (Spelling Distance)
Translating a keyword into a query containing the smallest value distance;

Example:
Spedis_Value = SPEDIS (title, "Michael"); (exact match is value 0)


COMPELVE (Levenshtein Edit Distance)
Provides an indication of how close tow strings are;

Example:
COMPLEV (Category, "Drama") as Complev_Number; (exact match is value 0)


COMPGED (Generalized Edit Distance)
Measure of dissimilarity between two strings;

Example:
COMPGED (M.Title, A.Title, 'ILN') as Compged_Score; (lowest score indicates better match)
I: ignore case, L: ignore leading blank; N:ignore quotation mark