Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Contains formula returns 0 and -1

LinhNguyen
8 - Asteroid

Hi,

 

I'm using the contains formula and instead of giving 0 and 1 (or False and True), it's giving 0 and -1, and it returns -1 when a "True" is expected.

For example: contains("one","e") returned -1

 

Could you let me know if this is an erorr or if it's normal? Why was it set up this way?

 

Thank you,

Linh

2 REPLIES 2
JosephSerpis
17 - Castor
17 - Castor

Hi @LinhNguyen that is expected behavior when you are working with a string field. If you changed the data type to boolean in the formula tool you are using with the contains formula than it would be 0= False and 1= True. This post helps to explain the rationale behind this.

LinhNguyen
8 - Asteroid

Thank you! turning the field into boolean made it True/False 🙂

Labels
Top Solution Authors