The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. 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

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