Community & Support
Learn
Marketplace
Menu
Menu
Home
›
Discussions
›
Community Q&A
How can I use more than 1 conditions in an IF statement to create a new attribute?
scooped
New Altair Community Member
Nov 2, 2021
Updated
Nov 5, 2024
by
Jocelyn
I use if(contains("SCOOP EGG",[subclass_english]),1,0) but I also want the result to come out to be 1 if there are other conditions like SCOOP EGG PAPER, PLANTS, BALLOONS within the same statement
Find more posts tagged with
AI Studio
All Replies
Sort by:
Sort by
Oldest
▾
1 - 1 of 1
↑
1
↑
BalazsBaranyRM
New Altair Community Member
Nov 2, 2021
Hi!
Generally, can use the && operator for a logical AND and || for a logical OR concatenation of your conditions.
So the expression would be something like
if(contains(...) || contains(...) || contains(...), 1, 0)
But if() in Generate Attributes has three parameters anyway, so you can put your conditions inside the if() if you want.
if(contains(...), 1,
if(contains(...), 1,
if(contains(...), 1,
0
)
)
)
Regards,
Balázs
Quick Links
All Categories
Recent Discussions
Activity
Unanswered
日本語 (Japanese)
한국어(Korean)
Generally, can use the && operator for a logical AND and || for a logical OR concatenation of your conditions.
So the expression would be something like
if(contains(...) || contains(...) || contains(...), 1, 0)
But if() in Generate Attributes has three parameters anyway, so you can put your conditions inside the if() if you want.
if(contains(...), 1,
if(contains(...), 1,
if(contains(...), 1,
0
)
)
)
Regards,
Balázs