Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Emma1
Contributor III
Contributor III

Using Wildmatch to filter by X or Y

I have this script that gives me count of various product categories containing nut and fruits. I need to adjust it to give me count of either Nut or Fruit. Please advice.

if(Wildmatch([Product],'*Nut*','*Fruit*')
OR Wildmatch([Liq Products ],'*Nut*','*Fruit*')
OR Wildmatch([Matched Products (All)],'*Nut*','*Fruit*'),
'Has Fruit and nuts', 'Does not have both') as Product_Flag

7 Replies
sunny_talwar

Isn't that what it is doing? Can you share an example where it didn't work?

Emma1
Contributor III
Contributor III
Author

The output is  count of products containing both nut AND fruit, but i want a situation where the script would return either nut OR fruit

sunny_talwar

I think the script should be returning the result as an OR condition and not as an AND condition.

Emma1
Contributor III
Contributor III
Author

So in that case my output should be labelled as

if(Wildmatch([Product],'*Nut*','*Fruit*')
OR Wildmatch([Liq Products ],'*Nut*','*Fruit*')
OR Wildmatch([Matched Products (All)],'*Nut*','*Fruit*'),
'Has Fruit or nuts', 'Does not have nut or fruit') as Product_Flag

Is that correct? Or how should it read? I'm confused.

Joseph022
Contributor
Contributor

I got the same errors as well. Do you have any idea how to solve it?

Gopi_E
Creator II
Creator II

Hi,

why can't you use like this for counting  Nut or Fruit

if([Product]='*Nut*', count([Product]))

 

Joseph022
Contributor
Contributor


@Gopi_E wrote: myprepaidcenter

Hi,

why can't you use like this for counting  Nut or Fruit

if([Product]='*Nut*', count([Product]))

 


I have no idea what i do exactly ?

please explain in detail.