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

Alteryx Designer Desktop Discussions

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

Unexpected behaviour of Contains(...) function

Paul_s_Moody
8 - Asteroid

Hi,

 

As part of a data cleansing workflow that is replacing an Excel workbook I'm using the content of one column to (in theory at least) generate a new column that should contain a True/False result. However, all records are being set to False rather a mixture of True and False as the data would suggest

 

Paul_s_Moody_2-1678101284240.png

 

To test this and see if something silly is going on, I've changed the formula to generate a string True/False and append the column containing the original data to the result. However you can see in the "test" in the configuration that the record in question DOES contain the text that I'm looking for, but is returning a false.

 

Paul_s_Moody_1-1678101252374.png

 

I'm sure it's just something silly in the way that I'm using the Contains(...) function, but I can't see anything obvious. 

I also get the same issue if i put the string I'm looking for in either single '   ' or double "   " quotes...

 

Can anyone suggest a way to solve the issue?

 

Thanks in advance

 

 

3 REPLIES 3
ChrisTX
16 - Nebula
16 - Nebula

Instead of "True" and "False", use

1 for True

0 for False

 

Chris

DataNath
17 - Castor
17 - Castor

Hey @Paul_s_Moody, the Contains() syntax should be Contains([FIELD], <Check>) - you're currently doing this the other way round i.e. Contains(<Check>,[Field]). Example:

 

DataNath_0-1678102038285.png

 

How yours is currently set up:

 

DataNath_1-1678102067117.png

Paul_s_Moody
8 - Asteroid

Thank you!

 

Glad it was just something daft in my formula!

Labels