Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Filter Data set with excel file, criteria with Regex

lukamso
6 - Meteoroid

Hi,

 

I stuck with resolving a situation in which there is need to filter a data set, and to avoid modifying the workflow each time the criteria changes I decided to use an excel file with a list of the criteria, the thing is, the criteria is like 5* or 654*, it mean we wanna see only the ones where the data start with 5 or 654. The filtered data will contain code numbers, held as string.

 

Would appreciate any kind of support on this.

2 REPLIES 2
AGilbert
11 - Bolide

This is a batch macro where each pattern from an external excel file is replaced in the regex_match function.

 

Also, a pattern of '5*' does not necessarily mean a number that starts with a 5. That pattern would match 'zero or more 5's' (e.g. 5, null, 555). I added some more example regex patterns to help explain. 

 

Screenshot 2024-06-12 143053.png

 

lukamso
6 - Meteoroid

Thank you, but i was not able to make this solution work on my project, probably cause of my short knowledge of macros in Alteryx.

 

Although I resolved the issue just by appending these two data sources, then adding a new column with formula StartsWith(String, Target), then filtering it to get just the True values ;)

Labels