Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

If then formula with REGEX

bryanmac_92
8 - Asteroid

How can I do a regex match with an IF THEN Statement where anything after the string is matched.

I.e. anything after X in ""ND.X" is matched and equal to 1.

 

Trying to apply that to my other strings as well in this formula below. 

 

IF [TRIMPROGRAM]="AUTH.AUT" or [TRIMPROGRAM]="AUTH.ASD.ZY" or [TRIMPROGRAM]="CRED.CTEL.ZY" or [TRIMPROGRAM]="CRED.CTEL" or [TRIMPROGRAM]="CRED.XA2" or [TRIMPROGRAM]="CRED.XA2.ZY" or [TRIMPROGRAM]="ND.X" THEN 1 ELSE 0 ENDIF

 

Attached is my workflow. Essentially, I am trying to make the new column equal to 1 based on a condition. I have many ND.X's so was wondering if there was a regex formula I can use where it catches anything after the X in ND.X

5 REPLIES 5
caltang
17 - Castor
17 - Castor

Please provide relevant data to this use case, and kindly provide your criteria in as much detail as possible. If you have a workflow built halfway, kindly export that over as well.

 

Quite hard to understand your issue...

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
flying008
15 - Aurora

Hi, @bryanmac_92 

 

Maybe like :

 

REGEX_CountMatches([TRIMPROGRAM], 'X.+?')
bryanmac_92
8 - Asteroid

Attached a workflow and updated post

caltang
17 - Castor
17 - Castor

Not sure I understand you fully, but if you're essentially looking for stuff after ND.X, you can try this.

 

image.png

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
PangHC
13 - Pulsar

if there have many texts to match, I suggest use find and replace.

it easier to extract and update. even can convert to excel. let it update by people without alteryx. 

 

we can split to 2 parts.

match by entire text and

match by beginning.

 

then use formula to combine the result.

Screenshot 2023-11-02 150259.png

Labels
Top Solution Authors