Edit distance: Levenshtein (levenshtein)
Creates a new column that returns the Levenshtein edit distance between two strings.
How does it work in the search window?
Select Create column in the search window toolbar, then select the Edit distance: Levenshtein operation. You need to specify two arguments:
The data type of the values in the new column is integer.
demo.ecommerce.data table, we want to know the Levenshtein distance between the strings in the referralUri and uri columns. To do it, we will create a new column using the Edit distance: Levenshtein operation.
The arguments needed to create the new column are:
- String - referralUri column
- String - uri column
Click Create column and you will see the following result:
How does it work in LINQ?
Use the operator
as... and add the operation syntax to create the new column. This is the syntax for the Edit distance: Levenshtein operation:
You can copy the following LINQ script and try the above example on the
from demo.ecommerce.data select levenshtein(referralUri, uri) as levenshtein