Hello.
I would like to find exact matches using list of keywords.
Sample keywords:
* In the real project, several keywords are more than one word (i.e. Cost effective or United States).
Sample Input:
Desired output:
Matched mostly "OK" when I used FindString formula, but there are a few cases that was not exact match (highlighted with red):
I then tried to use Find Replace tool for exact match. It worked well in terms of exact match, but I could only append one match even if there are multiple matched keywords.
Is there any way that I can find exact matches from multiple fields using the list of keywords?
I attached:
- Batch filter multiple keywords test workflow that includes two macros:
- Batch filter multiple fields macro (using find string formula)
- Batch filter exact match macro (using find replace tool)
Thank you for your help in advance.
Sincerely,
knozawa
Solved! Go to Solution.
Hi @knozawa
I think you can give the Find Replace method another try. This approach parses all the text in the three input fields by space to run the Find Replace tool on each word of the three input fields separately. Let me know if this is what you're going for.
Note: I made this case insensitive (see record 11 "apple Apple APPLE") by dropping a Cleanse tool after the Join tool, then used the Sample tool remove all the duplicates. I used the Cleanse tool one more time to put the "Keyword" back to title case.
This post is very similar to something @kavithabanda is working on here: REGEX-Match-function-to-match-subset
I wonder if you are working on the same project?
I attached the workflow. Hopefully this works for you both!
Thank you for your idea. Unfortunately, this method doesn't work well with my case. Apologies that I didn't include keyword with more than one word (i.e. Cost effective) in the sample keyword list. There are several keywords that have more than one word, so I don't want to split text to rows.
I didn't know about @kavithabanda's post, but it's interesting that some people have similar questions.
I wonder if there is any ways to do batch macro using Find Replace tool.
Sincerely,
knozawa
@knozawa too bad! I thought for sure we had it!
You're right. Phrases wont work with this approach, only single words.
I'll play with it later today (busy day @ work for me) but hopefully another user will chime in with the solution.
@knozawa how about this approach?
I padded the left and right of each input with spaces before it goes into your macro (which is very clever, by the way!). This works by replacing "apple" in your macro with " apple " to isolate it as a phrase. I added an example of "Cost effective" to represent a multi word phrase (see record #12 of text input (56) and record #10 on text input (57)). In your macro, "apple" is replaced with " Cost effective ". Note the spaces. The reason I padded the inputs for title, content, and abstract was to capture it if the phrase is at the beginning or end of the field. Lastly, I used a Cleanse tool to remove the leading and trailing white spaces that I created.
It is still case sensitive with this setup. See record 30 and 31 of Output (63) for "Apple" vs. "apple". I'm not sure if you want it to be case sensitive, but if not, the same logic of changing the case would work here.
Let me know if this works! Also, I'd love to hear if any of the Alteryx Aces have a more elegant solution. This was the only solution that came to mind.
See also attached.
It worked very well! Padding the left and right of each input with spaces was clever indeed! Thank you so much for your help.
Sincerely,
knozawa
You're welcome! That was a fun challenge!
Thanks @ddiesel, I can definitely pick some from this and put together the solution you suggested on my post. Nice work!
You're awesome! Please post on the road to inspire and let me give you a star!
cheers,
mark
@MarqueeCrew just posted! I found out about the contest from your post. Thank you!
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |