community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

Regex Function - Like Statement

Asteroid

Hi,

 

I am trying to use the regex function to simplify some of the processes in my work flow and to utilise it as a like statement (I don't think Alteryx has a "like" statement function). My main issue with the Regex is that I am not familiar with the terminology (or writing in Regex format) and I have looked via Google and other forums but cannot get a correct answer to my problem.

 

The attached files should hopefully shed some light on what it is i am trying to do.

Basically the "company name" field within my excel doc has several prefix or suffix (i.e. copy of, copy 2, do not use, import copy, to be deleted etc.) Sometimes there are variations of these and I would like to ensure to filter these out. I have used the formula tool and separated them out into different "arg" statements (as seen via the attachments). I would like a simpler approach via regex hopefully so it can filter out any variations/iterations of the above.

Is there a simple way of doing this task? Any help would be hugely appreciated.

Thanks :)

Alteryx Certified Partner
Alteryx Certified Partner

@Karlo,

 

How about an alternative method?  I think that what you want to do is construct a search list of terms.  These are exact matches for a set of words that result in a positive match.  I would create that list of terms and use the APPEND FIELDS tool to put them on your incoming data.  When you do this, you will replicate each incoming  record to match the term field.  With a single FORMULA took, you can write an expression of:

 

IIF(Contains([Variable_Name],[Search_Term]),1,0)

If you need to know which term was found, you can go through additional logic to know the value.  The data can then be SUMMARIZED to find the MAX result value, grouped by original key.  Now you'll know that it was found or not.

 

Cheers,

Mark 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Asteroid

 

 

Alteryx Certified Partner
Alteryx Certified Partner

@Karlo,

 

Your original post looked to simplify the process.  I don't think that we're exponentially larger.  If you are now performance centric, please consider putting a record id on each record and only passing the ID plus the field to be interrogated into the process described.  That will limit the I/O.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Labels