REGEX_MATCH
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
New to Alteryx, please see sample data attached. I am trying to produce a REGEX match based on values in the location column and looking for similar results seen in the match column. I am trying to match by any word/s separated by a comma, regardless if the words before the comma contains a space or not. I either get half the intended results or all true or all false. It seems this should be simple but I can't quite figure it out. Any input is greatly appreciated!
Solved! Go to Solution.
- Labels:
- Parse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think you need to explain this a little more - For example: What are you matching the cell with RIVER to? or LAKE to?
Location |
River |
Lake |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @rneco ,
I think I understand what you are trying to achieve comparing experssions between commas.
The problem is you need to tell REGEX a very general expression for example anything before first comma plus comma would be "(.*?)\,". You can't tell it find "Lake and River" and then compare with "River and Lake". I would just use simple Text to column and then formula to compare results Column1 and 2 and 3 if necessary. You can do something more fancy if you have unlimited combinations.
You could also add parsing by space and "and" within the comma groups if "Lake and River" should be same as "River and Lake".
Best of luck with your workflows,
Oly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello MattewBr,
Thanks for your response. River or Lake is not being matched to anything. Any value in the location column that does not contain a comma is not supposed to be matched to anything. Some values are one word and some are more than one with no commas. I was hoping REGEX had a way of matching by a word or words separated by a comma.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello oly,
I have an unlimited number of combinations so I might have to take another route. Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @rneco
Maybe something like this?
- Assign record ID
- Split to rows based on commas
- Count distinct location values per record ID
- Join count back to data
- Anything with more than 1 unique location is FALSE, otherwise TRUE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello Luke_C,
This worked perfectly! Thank a lot!
![](/skins/images/A7612391DEAF4EF69C140133EA533832/responsive_peak/images/icon_anonymous_message.png)