pinarello
Member
- Joined
- Jun 21, 2019
- Messages
- 218
- Reaction score
- 4
- Points
- 18
- Location
- Germany
- Excel Version(s)
- Office 365
A few years ago, just as a hobby, I developed a fuzzy search in our SAP system that, in my opinion, also works well. Then I had the idea to implement it in Excel. But since my VBA knowledge is rather modest, I didn't try to realize this idea.
But since I have been working with Power Query for some months now, I had the idea to realize the fuzzy address search with it, also because "Fuzzy" is offered as an option when joining 2 tables.
So I created a simple address table and a search mask and started.
First I wanted to match the search term "First name" (Connection Search-terms) against the addresses using Fuzzy-Join and load the result as a connection. This also works. But if I now want to connect this result (Search_F_name (3)) with the "Last name" from the connection "Search-terms" with a fuzzy join, then I run into an error, which I do not understand. This error is contained in the query "Search_L_name (3)".
Therefore I have changed my strategy and ask all search terms against the address table and show at the end the ones where the number of hits matches the number of search terms. I have created the following queries: Search_F_name, Search_L_name, Search_Street, Search_No, Search_Zip, Search_City and Search_result. The result is shown on the left side of the spreadsheet "Search".
Many different spellings of the name "Meier", but show the limits of the integrated fuzzy logic. That's why I wanted to improve it and created the table "Replacements", which is currently only maintained for "Meier". In the queries "Search-terms (2) and "Addresses (2)" I wanted to prepare, in additional columns, first name, last name, street and city for better search results.
Here I have the problem that the new column First_name, which is created from First name (without subtraction), is deleted as soon as I generate the column Last_name from Last name. So the question is, how can I perform multiple text replacements in a query?
But to see if and how the extended fuzzy logic affects the last name, I have only used it for the last name. The result is shown in the "Search" worksheet on the right.
Here are my questions again:
1. how can the fuzzy factor be set dynamically?
2. why can't the result of a fuzzy query be used as input for the next fuzzy query?
3. How can I apply replacements read from a table to multiple columns in a query?
But since I have been working with Power Query for some months now, I had the idea to realize the fuzzy address search with it, also because "Fuzzy" is offered as an option when joining 2 tables.
So I created a simple address table and a search mask and started.
First I wanted to match the search term "First name" (Connection Search-terms) against the addresses using Fuzzy-Join and load the result as a connection. This also works. But if I now want to connect this result (Search_F_name (3)) with the "Last name" from the connection "Search-terms" with a fuzzy join, then I run into an error, which I do not understand. This error is contained in the query "Search_L_name (3)".
Therefore I have changed my strategy and ask all search terms against the address table and show at the end the ones where the number of hits matches the number of search terms. I have created the following queries: Search_F_name, Search_L_name, Search_Street, Search_No, Search_Zip, Search_City and Search_result. The result is shown on the left side of the spreadsheet "Search".
Many different spellings of the name "Meier", but show the limits of the integrated fuzzy logic. That's why I wanted to improve it and created the table "Replacements", which is currently only maintained for "Meier". In the queries "Search-terms (2) and "Addresses (2)" I wanted to prepare, in additional columns, first name, last name, street and city for better search results.
Here I have the problem that the new column First_name, which is created from First name (without subtraction), is deleted as soon as I generate the column Last_name from Last name. So the question is, how can I perform multiple text replacements in a query?
But to see if and how the extended fuzzy logic affects the last name, I have only used it for the last name. The result is shown in the "Search" worksheet on the right.
Here are my questions again:
1. how can the fuzzy factor be set dynamically?
2. why can't the result of a fuzzy query be used as input for the next fuzzy query?
3. How can I apply replacements read from a table to multiple columns in a query?