Alteryx Designer Desktop Discussions

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

Using 'IN' within a Contains function?

aMac
8 - Asteroid

I'll start off by saying I LOVE that Alteryx allows for the use of IN within tools like the Filter!

 

HOWEVER, I am trying to evaluate if a dataset of large string fields contains 8 Ids and I'd rather not write 8 lines of 'contains' statements- is there a trick formula for filtering n-number values within a larger string field equivalent to something like:

 

Contains([Field], IN ("val1","val2","val3",val4", etc)?

 

 

14 REPLIES 14
MGT
6 - Meteoroid

Hi

I have a list of entities, I would like to identify the transaction booked within a list of entities. My formula is as follows, but I ma getting error. Can you help me figure out why?

Regex_countmatches([ETYBRCON], "I602|4352|4354|4359|4360|4392|9234|B658|I430|4404|4407”)

MarqueeCrew
20 - Arcturus
20 - Arcturus

Regex_countmatches(ToString([ETYBRCON]), "I602|4352|4354|4359|4360|4392|9234|B658|I430|4404|4407”)

 

maybe the data type is not string?  That's a guess...

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MGT
6 - Meteoroid

Data type is V_String, the error I get is Unmatched Quote

bb213
8 - Asteroid

can you PLEASE update this macro with an option to let all records pass through if no search terms are specified?  Thanks. 

cmsteinberg
5 - Atom

I guess I am 4 years late to the party, but I am wondering if there is a version of this macro where the input field was replaced by a file, so it can be modified by the end user as an input file for a more automated approach. 

 

And second, other than sequencing them, what if I want to run it on 5 fields?

Comment 1

Comment 2

Comment 3

Comment 4

Comment 5

 

Thanks in advance.

 

Labels