In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. 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

Creating new column and using an if statement

Samkim
5 - Atom

Hi 

 

I am new to Alteryx and am looking for a solution to my error below. I have created a new column  in my excel file and would like to use an if statement saying IF the field in column [Is Buffer Book] says "True", then output should be "1", "0"). 

 

Error: Parse Error at char(0): Invalid type in operator = =.

 

IF [Is Buffer Book] = "TRUE" THEN "1" ELSE "0" ENDIF

2 REPLIES 2
estherb47
15 - Aurora
15 - Aurora

Hi @Samkim 

Try changing the case in the IF to match what's in your data file.

 

Cheers!

Esther

DataKyle
8 - Asteroid

Is the field [Is Buffer Book] a string or a Boolean (bool) data type? 

 

If it is a boolean then Alteryx is already treating "TRUE" as 1 and "FALSE" as 0 in that field.

 

But if you're trying to make a new field you can use the formula to create a new field and use this:

 

if you want string output:

IF [Is Buffer Book] = 1 THEN '1' ELSE '0' ENDIF 

 

or if you want integers:

IF [Is Buffer Book] = 1 THEN 1 ELSE 0 ENDIF 

 

Labels
Top Solution Authors