Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
vikasshana
Creator II
Creator II

How to use OR in if statement

Hi,

I've below data.

ID New Value
1 abc 123
1 abc 456
1 abc 789
2 efg 963

 

I'm using the below IF statement to show the three values if I select 'abc' but it is showing only value '123'

if(match(ID,'1') and match(New'abc'),'123',if(match(ID,'1') and match(New,'abc'),'456' ,
if(match(ID,'1') and match(New'abc'),'789')))

I'm looking for an IF Statement to show all the three values if I select 'abc'.

Regards,

Vikas

@PrashantSangle @tresesco @sunny_talwar 

Labels (4)
5 Replies
BrunPierre
Partner - Master
Partner - Master

Try this

IF(Match(ID,'1') and WildMatch(New,'*abc*'),Value,Null()) as [abc Values]

MarcoWedel

Where are you applying this expression and what is your expected result regarding those three values given that a single expression only returns a single value per evaluation?

vikasshana
Creator II
Creator II
Author

I'm trying to apply this in the load script, my expected result is if user select abc the result should be three values associated to abc (123, 456, 789)

vikasshana
Creator II
Creator II
Author

Tried this but not giving the expected result.

BrunPierre
Partner - Master
Partner - Master

Hi @vikasshana 

I can assure you that the syntax works perfectly. And because it's conditioned selecting the value abc won't alter the output values.

LOAD *,IF(Match(ID,'1') AND WildMatch(New,'*abc*'),Value,Null()) as [abc Values];

LOAD * Inline[
ID,New,Value
1,abc,123
1,abc,456
1,abc,789
2,efg,963
];

O/P

BrunPierre_0-1664432883998.png