Free Trial

Alteryx Designer Desktop Discussions

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

Return the position of the last alphanumeric character in a string

ARHWAN0
5 - Atom

Hi,

 

Trying to come up with a formula that will return the position of the last alphanumeric character in a string.  Some examples:

 

ABCD,(*&&%&        would return 4
12346?>_                   would return 5
XXXXXXX                  would return 7
)&*()&%                       would return -1 (no alphanumeric exists)

 

Any help would be greatly appreciated!

2 REPLIES 2
binuacs
21 - Polaris

@ARHWAN0 one way of doing this

image.png

IIF(Length(REGEX_Replace([Data], '[^A-z0-9]', '')) <=0,-1,Length(REGEX_Replace([Data], '[^A-z0-9]', '')))
ARHWAN0
5 - Atom

@binuacs  Perfect, that was exactly what I was looking for; thanks!

Labels
Top Solution Authors