Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Parsing Country codes with RegEx

pnorby11
5 - Atom

I have a column with 4 digit Country codes bulked together.
Some records have multiple of these separated by comma and in some cases followed by "#".
Where I have: "OTHER USERS" or "DE USERS" or "PT USERS, I want to keep those as is.

Can you please advise what tools and expression would best fit to this scenario?
I am not too good at RegEx unfortuantely.

CURRENTDESIRED
AL00,#,AL00
IN50,IN50
XC01,XC00,#,XC01 XC00
OTHER USERSOTHER USERS
DE USERSDE USERS
PT USERSPT USERS
RO91,,#RO91
TR01,TR00,TR02,TR01 TR00 TR02
TR01,TR00,TR02TR01 TR00 TR02
3 REPLIES 3
messi007
15 - Aurora
15 - Aurora

@pnorby11,

 

Please see below :

 

messi007_0-1684491973243.png

 

Attached the workflow.

 

Hope this helps !

Regards,

binuacs
21 - Polaris

@pnorby11 @Another way of doing this with the ReplaceChar() function

 

Trim(ReplaceChar([Field],’,#’, ‘ ‘))

pnorby11
5 - Atom

Thanks a lot for that!, I tried and it worked perfectly!

Labels
Top Solution Authors