Start Free Trial

Alteryx Designer Desktop Discussions

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

Filtering by number of digits in a specific field

hovicke
5 - Atom

Hi - I have a large data file that has different product information in it. One of the columns has some description text as well as a number embedded somewhere in the description. I want to filter out the rows that contain only a 4 digit number in the description, nothing more or less than 4 digits. 

 

For example: Below is an example of the column of text/number. I want only the first the third rows because the number is 4 digits.

 

This product is low - 0832. Status is pending.

This product is medium - 034572. Status is good.

This product is high - 0447. Status is confirmed.

This product is none - 032. Status is pending.

 

Is this possible with the filter tool? I hope this makes sense.

3 REPLIES 3
PhilipMannering
16 - Nebula
16 - Nebula

Hey @hovicke 

 

You can use this regex expression in a Filter Tool,

NOT REGEX_Match([Text], '.*\b\d{4}\b.*')
NMangera
11 - Bolide

Hi @hovicke 

 

For your convenience. This is what the workflow looks like.

 

 

NMangera_0-1681401570223.png

 

PhilipMannering
16 - Nebula
16 - Nebula

Rereading your question, if you want to keep the ones with 4 digits, just remove the `not` at the start of the expression. Same difference, just switches the True and False.

Labels
Top Solution Authors