Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

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
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
Top Solution Authors