Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

OR operator issue

Hi all,

In script I have this statement:

if((match([Primary Currency],'CNH') or match([Secondary Currency],'CNH')),'Americas'


Even though the field "Secondary Currency" has a value CNH, this statement is not returning Americas. Why is this?

8 Replies
Anonymous
Not applicable

Hi,

If you have used the same statement as shown above, then your if statement is not closed properly. It should be

if((match([Primary Currency],'CNH') or match([Secondary Currency],'CNH'),'Americas')

sifatnabil
Specialist
Specialist
Author

Thanks greeshma.kalathingal‌ , actually it is closed properly, I just showed you a part of my script. The part which is causing issues is this part:

if((match([Primary Currency],'CNH') or match([Secondary Currency],'CNH'))

robert_mika
Master III
Master III

Works for me

2015-04-15 05_34_40-Edit Script [C__Users_Katarzyna_Desktop_160068.qvw_].png

Can you post your full expression?

Did you try Wildmatch?

Anonymous
Not applicable

Could you share a sample file?

tamilarasu
Champion
Champion

Hi,

Try this,


IF(match([Primary Currency],'CNH') or match([Secondary Currency],'CNH'),'America')


Instead of yours.

America should be mentioned inside the bracket, so that if statement will show as America. You have wrongly typed outside of the if statement.

if((match([Primary Currency],'CNH') or match([Secondary Currency],'CNH')),'Americas'


See below attached example.

Anonymous
Not applicable

you can also try

if((match([Primary Currency],'CNH','Americas' if (match([Secondary Currency],'CNH')),'Americas')

anbu1984
Master III
Master III

Check if spaces are present in fields [Primary Currency] or [Secondary Currency]

Also check if case mentioned in if statement matches with data present in the fields

PrashantSangle

Hi,

Few suggestion if you want case sensitive search go with Match()

if non case sensitive search go with Wildmatch

if there is spaces in it use wild character * or trim for removing before or after spaces.

Otherwise your expression is fine for me.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂