In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Filter if first 6 characters are digits

krishnagandhi
8 - Asteroid

Hi,

 

I am trying to solve an issue in my data. What i want to do is filter down one pathway if the first 6 digits are numbers and if false to go down a different pathway. I have all the downstream logic figured out, but just need to figure how to filter my data. I have included a sample below:

436717 Don Trim-MacDonald demob to NS
361055 Wilfred Hayman modules
519079 JASON BAUMLE
610233 Kevin Hoeg
557641 JEREMY ROBBINS
519079 JASON BAUMLE OFF SITE WORK
409073 - ALEXANDER BAGNYUK
409073-ALEXANDER BAGNYUK
409073-ALEXANDER BAGNYUK-TRAVEL
TRAVEL
595351-CHARLES TILLEY
566958 - Bowen Evans
TECHNICIAN,NDT,GENERAL FOREMAN

So i was thinking of a filter tool with a contains, but i couldn't get it to work. Note that the numbers are always the the beginning and would have to only be if there are 6 digits.

 

Thoughts?

 

Thanks!

4 REPLIES 4
Thableaus
17 - Castor
17 - Castor

Hi @krishnagandhi 

 

You can use REGEX.

 

REGEX_Match(Field, "\d{6}.*")

 

Cheers,

MichaelLaRose
10 - Fireball

Hi @krishnagandhi,

 

The filter tool will work you just need to use the following formula.

 

REGEX_MATCH(LEFT([Your Field Name],6), "[0-9]*")

 

See Attached.

 

Best,

Michael

MarqueeCrew
20 - Arcturus
20 - Arcturus

@krishnagandhi ,

 

for readability, simplicity and performance:

 

IsNumber(Left([text field], 6))

 

cheers,

 

mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MarqueeCrew
20 - Arcturus
20 - Arcturus

@krishnagandhi ,

 

 if you really wanted a regex expression that you don't completely understand,

 

Regex_Match([your field],"\d{6}.*")

 

 cheers,

 

mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors