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

IF Statement

student123456
5 - Atom

Hello,

 

When I use the formula:

 

IF Length([pcd7])=7 THEN Left([pcd7], 5) ELSEIF ([pcd7])=6 THEN Left([pcd7], 4) ELSEIF ([pcd7])=5 THEN Left([pcd7], 3) ELSE [pcd7] ENDIF

 

I receive the error message "Parse Error at char (0): Invalid type in operator =="

 

My data type match up, as they're both string. It works fine as a single if statement. 

 

Can someone please advise where I am going wrong? 

 

Thank you!

2 REPLIES 2
kelsey_kincaid
12 - Quasar

Hi @student123456 ,

Try updating your formula to this:

 

IF Length([pcd7])=7 THEN Left([pcd7], 5) ELSEIF Length([pcd7])=6 THEN Left([pcd7], 4) ELSEIF Length([pcd7])=5 THEN Left([pcd7], 3) ELSE [pcd7] ENDIF

student123456
5 - Atom

Perfect! Thank you.

Labels