Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

I'd 'like' some help please - Like vs Substring

DanN
6 - Meteoroid

Hi Alteryx Community

 

I'm trying to replicate the following SQL formula in Alteryx with the formula tool:

 

WHEN *COLUMN* LIKE '_SET__TEXT______________TEXT' THEN 'OUTPUT '

 

Is there a way in Alteryx to copy this, taking into consideration where the wildcare (underscores) are and set text or would I have to create 3 substrings and one LEN function linked by an AND function?

 

Ideally I would be able to use a 'contains', which also allows wildcards, so I could do something like: '*SET**TEXT***************TEXT'

 

Thanks

4 REPLIES 4
Meardon
5 - Atom

Hi Dan, you could use the regex tool, with output method set as "match" on your column with a regular expression like:

.*SET.*TEXT.*TEXT

 This exact regex statement may need some work but I hope that points you in a good direction.

IraWatt
17 - Castor
17 - Castor

Hey @DanN,

I'm no expert on SQL but this definitely sounds like something you would want to use the regex tool to sort:

IraWatt_0-1656426292180.png

Would be great to have some example data but I think this is a start:

(.*SET.*TEXT.*TEXT)

 

DanN
6 - Meteoroid

Perfect, even tagged the request as Regex, not realising it was exactly what I needed! Great tool, would be really good if you could do multiple expressions per tool, maybe in the future!

IraWatt
17 - Castor
17 - Castor

Great to hear @DanN !  regex101: build, test, and debug regex Is a great place to test and try regex btw when your getting started. 

Labels
Top Solution Authors