In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Filter using StartsWith and an Array of Phrases

hellyars
13 - Pulsar

Hi,

 

I want to filter using STARTSWITH and an array of values.  I tried this, but it does not work

 

!(StartsWith([HD], 'Notice|Policy|Transfer|Supplemental|Annex'))

 

Thanks!

3 REPLIES 3
jrgo
14 - Magnetar

@hellyars 

 

Alternate values don't work in most of the Alteryx functions other than with REGEX. You can either

 

NOT(
StartsWith([HD], 'Notice')
OR
StartsWith([HD], 'Policy'
OR
ETC...)

 

 

or

!REGEX_MATCH([HD], '^(Notice|Policy|Transfer|Supplemental|Annex).+$')

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

The first way that comes to mind would be to use Regex_Match:

 

Regex_Match([Values], '^(?:Training|Checking).*')

 

This would check for values starting with "Training" or "Checking" and would not be case sensitive. You could add more after "Checking" using a pipe | delimiter between. So for example a third would be:

 

Regex_Match([Values], '^(?:Training|Checking|Testing).*')

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

hellyars
13 - Pulsar

@jrgo 

 

Thanks.  The REGEX expression worked.  

!REGEX_MATCH([HD], '^(Notice|Policy|Transfer|Supplemental|Annex).+$')

 

Labels
Top Solution Authors