Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Match Clause

Hi,

I am struggling with a match clause and am not sure of another way to get the result I am looking for.

When I do this, I get the result I am looking for:

=If (MATCH ([C_Code],'KAT 001','AACC 000','ZAM001','PLO 001'),'P CUSTOMERS')

But when I alter it to use numbers, then it doesnt work:
=If (MATCH ([S_App Number],'408600000','20000000','40500000',),'P CUSTOMERS')

Do you perhaps know what I am doing wrong?

Thanks

Yolanda

Labels (1)
4 Replies
srchilukoori
Specialist
Specialist

Hi,

please post a sample data. My guess is the number format in the [S_App Number] is changed while loading in to the app.

Thanks.

Not applicable
Author

Hi Yolanda,

Looks like you have an extra comma:

=If (MATCH ([S_App Number],'408600000','20000000','40500000',),'P CUSTOMERS')

CORRECTED:

=If (MATCH ([S_App Number],'408600000','20000000','40500000'),'P CUSTOMERS')

prabhu0505
Specialist
Specialist

That means:

MATCH ([C_Code],'KAT 001','AACC 000','ZAM001','PLO 001') - has match (Match functions returns positive value).

MATCH ([S_App Number],'408600000','20000000','40500000',) - does not have a match (Match functions returns zero). Moreover I could see one extra comma before parenthesis '40500000',) pls take care.

Qrishna
Master
Master

Try

=If (MATCH ([S_App Number],'408600000','20000000','40500000'),'P CUSTOMERS')  //extra comma as prabhu stated


=If (MATCH ([S_App Number],'408600000','20000000','40500000') =1,'P CUSTOMERS')

//sometimes Match() condition in if() statement needs to be checked to return the output for the condition.

//match(') = 1 true ,match(') = 0 false - something like this