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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Does anybody see any error in the below if statement

 

if(match(Category,'4','9','16','21','22')=0,'Trust_Non-Reccuring','Trust Reccuring') as Feetype,

When I run this script I am getting only one value i.e Trust_Non-Reccuring in the field Feetype.Why am I missing Trust Reccuring value from the field ?

Thanks in advance.

4 Replies
swuehl
MVP
MVP

Such a question is hard to answer without knowing the values from field Category.

martinpohl
Partner - Master
Partner - Master

try without = 0

if (match(value, matches), then , else)

Regards

jerem1234
Specialist II
Specialist II

Seems like nothing is matching your values 4,9,16,21,22. I would check your data. Maybe you are looking for a wildmatch?

if(wildmatch(Category,'*4*','*9*','*16','*21*','*22*')=0,'Trust_Non-Reccuring','Trust Reccuring')


But thats just a complete guess.


Hope this helps!

chiru_thota
Specialist
Specialist

Hi,

Match function returns position number if category values matches with 4','9','16','21','22...not always zero (0).

try this:

if(match(Category,'4','9','16','21','22') > 0,'Trust_Non-Reccuring','Trust Reccuring')

The match function performs a case sensitive comparison.

Example:

match( M, 'Jan','Feb','Mar')

returns 2 if M = Feb

returns 0 if M = Apr or jan