Fuzzy Matching/Lookup with Power Query

Dane0987

New Member
Joined
Mar 28, 2017
Messages
2
Hi Guys,

Having trouble writing a power query function to accomplish fuzzy matching/lookup. Would really appreciate any help.

Here's the scenario:

Lookup table:
This table contains the SQL like operator (I think this can be used in M-code. In Excel I would use *)
[TABLE="class: grid, width: 300"]
<tbody>[TR]
[TD]%Australia%[/TD]
[TD]Australia[/TD]
[/TR]
[TR]
[TD]%China%[/TD]
[TD]China[/TD]
[/TR]
[TR]
[TD]%Brazil%[/TD]
[TD]Brazil[/TD]
[/TR]
</tbody>[/TABLE]

Fact table:

[TABLE="class: grid, width: 300, align: left"]
<tbody>[TR]
[TD]Text string[/TD]
[TD]Country[/TD]
[/TR]
[TR]
[TD]35 Stirling Highway Perth WA 6009,Australia[/TD]
[TD]Australia[/TD]
[/TR]
[TR]
[TD]Parque Cidade (Brazil) Corporate SCS[/TD]
[TD]Brazil[/TD]
[/TR]
</tbody>[/TABLE]








I essentially want to search for a keyword (found in lookup table) in any text string in the fact table and apply the result in a new column in my fact table (Country).

I can do this in Excel with this type of formula: =LOOKUP(2^15,SEARCH(D$2:D$6,A2),E$2:E$6).

But when the lookup and fact tables are large then the formula is slow to calculate. That''s why I wanna do this in Power Query. However, I'm a complete beginner with Power Query. Still learning formulas
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Thanks Craig. Appreciate the prompt reply. The Fuzzy Lookup add-in is a great tool which I often use. But I think its based on the Jaccard Index formula which would mean the text string length is important. In my case, I may have a really long text string such as an address - so one keyword somewhere in there could give me the associated country, for example.
 
Upvote 0

Forum statistics

Threads
1,223,104
Messages
6,170,126
Members
452,303
Latest member
c4cstore

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top