Forum

Merge Query based o...
 
Notifications
Clear all

Merge Query based on Column Containing Text

4 Posts
2 Users
0 Reactions
478 Views
(@patri0t82)
Posts: 43
Trusted Member
Topic starter
 

Hello,

I have Table1 containing a column called [Business Lines]. I have Table2 containing [Text String] and [Operating Area].

I'm trying to perform a type of Merge Query, where it will search Table1[Business Lines] for the first match of Table2[Text String] and return Table2[Operating Area].

 

I tried fuzzy Merge Query and it didn't function at all like I had hoped. I also came across some code online at this page: https://stackoverflow.com/questions/62327202/power-query-function-to-search-for-matching-keywords-in-a-table-of-lists-and-ret

which was very close, but also came back with Operating Areas that simply did not match. 

 

Any help is, of course, greatly appreciated.

 
Posted : 05/03/2021 1:53 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi Adam,

Can you please supply some sample data in an Excel file.

Thanks

Phil

 
Posted : 06/03/2021 12:53 am
(@patri0t82)
Posts: 43
Trusted Member
Topic starter
 

Hi Philip, sorry I didn't do that. I may have discovered the solution. The code used "Comparer.OrdinalIgnoreCase" I believe.

I removed the ignore case, and it's picked up the words perfectly. Thanks again for being available, as usual.

 
Posted : 06/03/2021 8:07 am
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

OK no worries.  Glad to hear you got it figured out

 
Posted : 09/03/2021 10:43 pm
Share: