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

Error: Formula (38): Parse Error at char(119): Malformed If Statement (Expression #4)

Karl_Spratt
8 - Asteroid

Hi Community ,

Need some help please, I'm trying to write a IF formula to say 

If the Frame column contains the value SIMMERN  ( there are F1 SIMMERN and F2 SIMMERN values in this column along with other values, also GD Or Champ Item contains the partial value IR

 

This is what I wrote, and I'm getting the error 

IF Contains([Frame], "SIMMERN")
AND If Contains([GD Or Champ Item], "IR")
THEN 'IR /GD Brand' ELSE 'Non IR Brand' ENDIF

 

Can someone please explain the fix here please. 

 

 

 

2 REPLIES 2
binuacs
21 - Polaris

@Karl_Spratt 

 

IF Contains([Frame], "SIMMERN") AND Contains([GD Or Champ Item], "IR")
THEN 'IR /GD Brand'

ELSE 'Non IR Brand'

ENDIF

grazitti_sapna
17 - Castor

@Karl_Spratt, the formula you mentioned contains an IF after and operator which is incorrect

 

IF Contains([Frame], "SIMMERN")
AND If Contains([GD Or Champ Item], "IR")
THEN 'IR /GD Brand' ELSE 'Non IR Brand' ENDIF

 

Correct Syntax:

IF Contains([Frame], "SIMMERN")
AND Contains([GD Or Champ Item], "IR")
THEN 'IR /GD Brand' ELSE 'Non IR Brand' ENDIF

 

I hope this helps!

 

Thanks!

Sapna Gupta
Labels
Top Solution Authors