# LevenshteinDist - script and chart function

LevenshteinDist() returns the Levenshtein distance between two strings. It is defined as the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. The function is useful for fuzzy string comparisons.

Syntax:

LevenshteinDist(text1, text2)

Return data type: integer

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringFunctions/LevenshteinDist.htm)

#### Examples and results:

| Example | Result |
| --- | --- |
| `LevenshteinDist('Kitten','Sitting')` | Returns '3' |