We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex, parse out last 4 digits if its 4 digits, if its 6 digits, parse out first 4

wonka1234
10 - Fireball

Hi,

 

I am trying to parse this - 

 

TEST_NewUser_IDString_20221031
TEST_NewUser_IDString_202202

to this

 

202210

202202

 

How can I do this with regex?

1 REPLY 1
bbak91
Alteryx
Alteryx

Give the attached workflow a try. You mentioned 4 characters in your original question, but it looks like you actually want to parse 6 characters. If this is the case you can just change the length parameter in the LEFT function in the formula tool. 

 

 

parsing.png

Labels
Top Solution Authors