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.

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