Alteryx Designer Desktop Discussions

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

Regex replace with Conditional loop

EN6924
10 - Fireball

Hello All,

 

First 2 columns are my input data as per the attached file. 3rd column mentioned in excel file will be the output.

 

I can be able to create the output using Regex for a single row -

 

EN6924_0-1643791655598.png

 

Also can able to do using if-else+Replace function. Workflow attached.

 

Need to know how to do this using Regex.

 

Please help.

 

 

 

 

 

 

2 REPLIES 2
mceleavey
17 - Castor
17 - Castor

Hi @EN6924 ,

 

in short, not in any way that would be any more efficient. Is there any reason why you want to specifically use Regex?

 

I've attached an updated version with a Find and Replace method that removes the need for a huge IF statement.

NOTE: You can remove the "Replace" column and simply replace the entire field with the Data Output column if that's what you want to do. That will remove another step.

This method is much easier to maintain as nobody likes a huge IF statement :)

 

M.



Bulien

EN6924
10 - Fireball

Thank you for your help. You're right, better to use Find and Replace instead of If-else loop.

 

There was no specific reason though. Just wanted to know if that can be done easily with the help of Regex.

 

Labels