In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start 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
6 - Meteoroid

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
binu_acs
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
6 - Meteoroid

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

Labels
Top Solution Authors