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

CASE WHEN STATEMENT not working

udles5666
8 - Asteroid

Hi Community,

 

I am stuck with a calculation (IF function). It throws an error below. 

 

Error: Formula (3): Parse Error at char(43): Invalid type in operator ==. (Expression #1)

 

IF [Result] = 0 THEN "No"
ELSEIF [Result] = 1 THEN "Yes"
ELSE [Result]
ENDIF

 

I cannot change the data type to double as it erases text. Can you please advise the workaround. Thanks

4 REPLIES 4
grazitti_sapna
17 - Castor

Hi @udles5666 , is this what you are loking for?

 

Formula:
IF [Result] = '0' THEN "No"
ELSEIF [Result] = '1' THEN "Yes"
ELSE [Result]
ENDIF

 

grazitti_sapna_0-1597811913300.png

 

As the datatype of the field result is v_string so you need to pass the values in quotes and it will work.

Please refer to the screenshot and workflow attached.

Thanks.

 

Sapna Gupta
grazitti_sapna
17 - Castor

Hi @udles5666,

 

Also if the yxzp file throws you an error of newer version you can always extract the file and then open the yxmd file in notepad and change the version to the one you are using.

Thanks.

Sapna Gupta
udles5666
8 - Asteroid

hi @grazitti_sapna 

That was easy! Silly me - Thanks!

grazitti_sapna
17 - Castor

@udles5666 , welcome.

Sapna Gupta
Labels