Alteryx Designer Desktop Discussions

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

Filtering a column of data to return alpha-information only

Archaeopteryx
10 - Fireball

Hi,

I found in this forum how to use a REGEX along with the "false" path of the Filter tool to pull only those rows where a column does not contain numeric data, REGEX_Match([column name], "\w+"). I placed this in a variable expression and utilized the 'false' of the Filter path to obtain only those rows where that column contains only alpha data. But, some of the cells in the column have dates formatted, YYYY-MM-DD.

 

Can I modify the REGEX expression to include data formatted like that? Or would I need to use an AND clause in the expression? If the latter, how would I formulate the expression to target date formatted information?

 

Thank you,

Chris

 

13 REPLIES 13
Archaeopteryx
10 - Fireball

So, hopefully all of you are still following this. I have changed up the REGEX a little bit. See below:

 

REGEX_Match([NEW VALUE],"^[0-9]") OR
REGEX_Match([NEW VALUE],"\d{4}-\d{2}-\d{2}")

 

So, the top expression captures "single digit" numbers. The two rows that were problematic before have gone through the proper Filter channel. A variation on the bottom expression may help with targeting numbers that are two and three digits long. I'll give it a go.

 

 

Archaeopteryx
10 - Fireball

Okay, this may not be elegant or pretty, but it works::

 

REGEX_Match([NEW VALUE],"\d{1}") OR
REGEX_Match([NEW VALUE],"\d{2}") OR
REGEX_Match([NEW VALUE],"\d{3}") OR  
REGEX_Match([NEW VALUE],"\d{4}-\d{2}-\d{2}")

 

So, I'm capturing single,double, triple digit number and date formatted numbers with the above REGEX.

Since I do not want such data, I filter these results through the 'true' path of the filter.

The data I want is strictly alpha, which is the output filtered via the 'false' path.

 

Thanks for helping me with the initial ask, or I would not have got this far.

Chris

MarqueeCrew
20 - Arcturus
20 - Arcturus
REGEX_Match([NEW VALUE],"\d+") OR
REGEX_Match([NEW VALUE],"\d{4}-\d{2}-\d{2}")

Or you can try:

REGEX_Match([NEW VALUE],"[0-9\-\/]+")

The new expression looks for any of the following characters {0,1,2,3,4,5,6,7,8,9,/,-} one or more times.
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Archaeopteryx
10 - Fireball

Much more elegant. Thank you.

Chris

Labels