ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RESUELTAS

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

Karl_Spratt
Asteroide

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 RESPUESTAS 2
binu_acs
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
Cástor

@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
Etiquetas
Autores con mayor cantidad de soluciones