Alteryx Designer Desktop Discussions

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

IF ELSE STATEMENT WITH LIKE Condition

kathbanc
8 - Asteroid

Hi! 

 

Please help me, what is the syntax for like in IF ELSE Statement. 

 

IF [SLoc] like 'PA%' THEN '234'
ELSE [SLoc] ENDIF

 

This one is error 

 

 

Thank you 

2 REPLIES 2
gawa
15 - Aurora
15 - Aurora

hi @kathbanc 

StartsWith and/or EndsWith function can be used for equivalent statement to LIKE in SQL query.

 

If you want to match the beginning of words, use StartsWith().

StartsWith([SLoc], "PA")

 Or, If you want to match the end of words, use EndsWith(). 

EndsWith([Sloc], "PA")

 

kathbanc
8 - Asteroid

Thank you @gawa it works!! Thank you so much 

Labels