Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Malformed if Statement with Wildcard

gene_denny
8 - Asteroid

Hoping someone can help.  Not finding an answer when searching the Community.  Here's what I have in place:

 

Capture.GIF

 

I need to be able to use a LIKE type of statement and each condition is multi-part.  Open to suggestions.

 

Tried to post this yesterday, but it seems to have not gone through.

 

Thanks!!!

 

--Gene

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

Try:

IF StartsWith([number], "01") AND [name] = "1" THEN "S1"
ELSEIF StartsWith([number], "01") and [name] = "2" THEN "S2"
ELSE [name]
ENDIF

Note that this assumes number and name are string fields

 

If you need more wildcards then regex_match is probably the easiest way to go.

 

If numbers then either use a select to change the type or you can replace [number] with ToString([number])

 

 

gene_denny
8 - Asteroid

Yep, that appears to have done it.

 

Thank you SO much!  You're a Rock Star!

Labels