Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

filter if the field value starts with a Letter

parria1
8 - Asteroid

I have an input source with a field AC_NUM that can start with a digit or a letter. Examples are

88584848

MF83838

 

I want to place a filter on this input source so I can have two data streams: one where the field starts with a digit and another where the field starts with a digit.

 

so far I have a filter tool with the formula regex_match([AC_NUM],"^\D"). this does not work. There are no results in the true and all results are in the false.

 

what am i doing wrong? when i put ^\D into https://regex101.com/ to test, it highlights the M so I thought this should work. It highlights nothing on the 88584848.

2 REPLIES 2
Claje
14 - Magnetar

Try this:

regex_match([AC_NUM],"^\d.*")

 

Your D needs to be lowercase (regex_match is case sensitive) and you need a .* afterwards so that it checks the rest of the field.


Alternatively you could use

regex_match(LEFT([AC_NUM],1),"^\d") which would do the same thing but only look at the first character

ivoller
12 - Quasar

regex always plays with my brain too. i tend to go with the long winded but easy for me left([AC_NUM],1)>="0" && left([AC_NUM],1)<="9"

 

Iain

Labels
Top Solution Authors