Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

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