Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
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

 

binu_acs
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