I would like to ask for your help with the power query-related problem I cannot solve on my own:
One of the columns [address] contains data like this :
Science Park 404, 1098 XH Amsterdam, Netherlands
Laan van Malkenschoten 20, 7333 NP Apeldoorn, NL
plac Europejski 1, 00-844 Warszawa, Poland
Adrianastraat 6, 3014 XL Rotterdam, Netherlands
C. Co Brava, 109, 17411 Vidreres, Girona, Spain
I also have a list of keywords, that contain: Amsterdam, Apeldoorn, Rotterdam
What I need is that power query checks if [address] column contains any of the keywords, and if yes, in a new custom column display ‘MATCH’:
Science Park 404, 1098 XH Amsterdam, Netherlands MATCH
Laan van Malkenschoten 20, 7333 NP Apeldoorn, NL MATCH
plac Europejski 1, 00-844 Warszawa, Poland
Adrianastraat 6, 3014 XL Rotterdam, Netherlands MATCH
C. Co Brava, 109, 17411 Vidreres, Girona, Spain
The list of keywords is stored in the same Excel file, in a one-column table called ‘CITIES_NL’
In theory, I can create a conditional column and hard-code the keywords, however I cannot do it for two reasons:
- the list needs to be dynamic, it is likely that new keywords will be added on a daily basis
- in production, the list of keywords would consist of 75k items, it is impossible to enter this to PQ
To achieve the same in Excel, without PQ, I would use this formula:
=IF(--SUMPRODUCT(--ISNUMBER(SEARCH(CITIES_NL,address)))>0,"MATCH","")
however, this has to be done by PQ, as this is only one of the steps for preparing my data
I would appreciate your help!
Michal