Calculate distance for each row

Hi, i’m pretty new to this use of knime, so i’m sorry if the question is silly.

I have a very small dataset (5 rows) and for each row i want to calculate the value of the levensthein distance, of the values of the column documentNumber, from all the others row and save in a new column the value of the lower. so for each row i calculate 4 distance and save the lowest. do you know how can i do it without using java or python script? I tried with python node and it’s pretty simple but for specific reason i have to use knime node.

Hope to have been clear, thank you very much

Hello there @Gabrielefas,

and welcome to KNIME Community!

There are quite a lot of distance nodes - Java, String, Matrix, Numeric which output distance port. And there is Similarity Search node you can use and where output is classic KNIME table. Or you can combine them together. Give it a try and see if they solve your problem. In general it’s good approach to share some input (dummy) data and expected output so users can easily experiment and offer their solutions.

Br,
Ivan

4 Likes

Hi @Gabrielefas

You can calculate the Levensthein Distance with the String Similarity node.

gr. Hans

6 Likes

Thank you very much to both, the string similarity node suited perfect for me. Do you know if, instead of using the Levensthein distance, is possible to find how many change are need to transform a string into another (they are 2 columns of the same row) and save it? i’ll attach and example to explain better: for each row i want to find how many change (add, remove or change) i have to perform to transform the string in the column numeroDocumento into the string in the column numeroDocumento (#1)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.