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
20 - Arcturus

@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