Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

If statement with IfContains

akshaya2595
5 - Atom

I am trying to write a formula statement with the following condition:

 

If Func = "D" AND FuncType Contains "M" OR FuncType Contains"L" Then "Da"

else if Func = "P" AND FuncType Contains "Pr" OR FuncType Contains "Se" Then "Pro"

Else "Others"

 

What is the write syntax to write this statement?

 

Thank you!!

3 REPLIES 3
Felipe_Ribeir0
16 - Nebula

Hi @akshaya2595 

 

Use this one:

 

If Func = "D" AND (Contains([FuncType], "M") OR CONTAINS([FuncType], "L")) Then "Da"
elseif Func = "P" AND (Contains([FuncType], "Pr") OR Contains ([FuncType], "Se")) Then "Pro"
Else "Others"
ENDIF

 

Felipe_Ribeir0_1-1666029695923.png

 

Felipe_Ribeir0_0-1666029682556.png

 

binuacs
21 - Polaris

@akshaya2595 One way of doing this

 

If [Func] = "D" AND (Contains([FuncType],"M") OR Contains([FuncType],"L")) Then "Da"
ElseIF ([Func] = "P" AND (Contains([FuncType],"Pr") OR Contains([FuncType],"Se")) Then "Pro"
Else "Others"
EndIf
Felipe_Ribeir0
16 - Nebula

Hi @akshaya2595 

 

It worked?

Labels
Top Solution Authors