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

Wildcard in middle of string

smixon
6 - Meteoroid

Hiya,

 

I've been looking across multiple threads but couldn't find anything exactly what I needed.  I know that I can use things like CONTAINS() and REGEX_MATCH() to find specific characters within strings, akin to something like:

 

LIKE '%HELLO_THERE%'  in SQL, using the % as wildcard for anything that comes before or after my characters.  I could write CONTAINS([Field],'HELLO_THERE') and get that result in Alteryx.

 

My question comes about with Wildcards in the middle of the string - in SQL it could look like:

 

LIKE '%HELLO%THERE%', and then it will return anything where the word HELLO precedes the word THERE, regardless of any characters before, between, and after it.  Is there anything within Alteryx that would achieve this?  I've tried a combination of formulas / values and can't seem to work it out.

3 REPLIES 3
AndyBate
8 - Asteroid

Hi,

 

Apologies if I've misunderstood but based on what you've said, i think the RegexMatch would still work well for you. 

However you would replace the underscore with .* as this states any character can be between the two words. Example formula below. 

 

REGEX_Match(sql, '%HELLO.*THERE%')

 

hope this helps

Qiu
20 - Arcturus
20 - Arcturus

@smixon 

Based on the idea of @AndyBate , but replace the % at the beginning and end the RegEx and use RegEx Tool to parse.

Capture3.PNG

smixon
6 - Meteoroid

Thanks.  I think the key was understanding the .* as the correct wildcard feature, versus SQL is %.

Labels