In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

support with "in" function

janez_007
7 - Meteor

hi all

 

I am trying to use the "in" function to search for a string in a list of strings (e.g.: search for 'a' in ('a','b','c')) and it works if I hard code the values, but does not work if the values are stored in a variable (column).

 

Let's say the data looks like this:

[Search]  |  [List]

'a'            |  'a','b','c'

 

If I configure the formula as follows --> [Search] in ('a','b','c') --> it works, but if I do --> [Search] in [List] --> it does not work (tried with and without the " ' "). Why is that?

 

p.s.: I know I could use contains([List],[Search]), but I am interested in why the 'in' function does not work...

 

Thank you.

2 REPLIES 2
JoeS
Alteryx Alumni (Retired)

Alteryx will be treating the [List] field as one value.

 

The expression will treat each entry separated by a comma as a whole value, as opposed to the values within those entries. It's not dynamically looking into the values for a comma separate list as well (god that's horrible to try and write, but hopefully makes sense?).

 

As you say Contains() will work in your scenario, or please have a look at the dynamic formula as part of the CReW macros here

janez_007
7 - Meteor

thank you, Joe

Labels
Top Solution Authors