Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Regex Function

Sarita_Kumari
6 - Meteoroid

Hi Everyone,

 

How do i achieve the below:-

 

So the input string contains or may not contain 'RESCAN' and 'RESCAN-SAMPLE'. I should identify only 'RESCAN'. These values can be anywhere in the input  string

 

Sarita_Kumari_0-1622188578593.png

 

 

 

 

9 REPLIES 9
atcodedog05
22 - Nova
22 - Nova

Hi @Sarita_Kumari 

 

Can you provide more explanation and data as sample.

Sarita_Kumari
6 - Meteoroid

Hi, 

 

I Have the more sample data and a more clear description

atcodedog05
22 - Nova
22 - Nova

Hi @Sarita_Kumari 

 

You can use formula like below should work.

 

If Contains([field],"RESCAN-SAMPLE") then 0 else 1 endif

 

Sarita_Kumari
6 - Meteoroid

Aplogies! I should have been more precise.

 

The string may or may not contain 'RESCAN' and 'RESCAN-SAMPLE'.  I need to find the strings where only 'RESCAN' value is present

messi007
15 - Aurora
15 - Aurora

@Sarita_Kumari 

 

You can use RegEx as well

 

messi007_0-1622188867933.png

Attached the workflow,

Hope this helps!

Regards

atcodedog05
22 - Nova
22 - Nova

Hi @Sarita_Kumari 

 

Can you provide the same sample data in an excel so that we can work on it.

Sarita_Kumari
6 - Meteoroid

Hi, I do want 'RESCAN-SAMPLES' to come as TRUE

atcodedog05
22 - Nova
22 - Nova

Hi @Sarita_Kumari 

 

Below formula should work. I am checking for 'RESCAN-SAMPLE' if its there 0 else if 'RESCAN' is there 1 else 'RESCAN' is not at all there then 0. 

 

If Contains([Field1],"RESCAN-SAMPLE") 
THEN 0
ELSEIF Contains([Field1],"RESCAN") THEN 1 
ELSE 0 ENDIF

 

 

Workflow:

atcodedog05_0-1622191011821.png

 

Hope this helps 🙂

messi007
15 - Aurora
15 - Aurora

@Sarita_Kumari,

 

below the updated formula

 

messi007_0-1622193271171.png

 

Regards,

Labels