Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

Filter

Hi, I am currently using wildmatch to create a filter that searches a specific column for the presence of a number of strings.

for example, the column would be called Fruits and a value inside of it would look like

Apple, Pear, Peach, Orange, Apple Pear

Currently, I have several filters with the following codes:

If(WildMatch([Fruit$.Fruit Type],

'*Apple*',

'*Orange,*',

'*Grape,*',

'*Pear*',), 'Tasty Fruits')

If(WildMatch([Fruit$.Fruit Type],

'*Lemon*',

'*Lime,*',

'*Apple Pear,*'), 'Decent Fruits')

I would like to be able to filter and only show things that are 'Tasty Fruits' . However, in the case of Apple and Apple Pear, the Tasty Fruits Filter would pick up Apple Pear as Apple due to the asterisks.

Is there any way to fix this problem? Thanks!

Tags (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar
Not applicable

Re: Filter

Perhaps like this:

If(WildMatch([Fruit$.Fruit Type],

'*Apple,*',

'*Apple',

'*Orange,*',

'*Grape,*',

'*Pear*',), 'Tasty Fruits')


If(WildMatch([Fruit$.Fruit Type],

'*Lemon*',

'*Lime,*',

'*Apple Pear,*'), 'Decent Fruits')



talk is cheap, supply exceeds demand
4 Replies
OmarBenSalem
Not applicable

Re: Filter

Change this :

If(WildMatch([Fruit$.Fruit Type],

'*Lemon*',

'*Lime,*',

'*Pear,*'), 'Decent Fruits')

Not applicable

Re: Filter

Hi Omar,

Thanks for the reply. I have tried this. However, by adding the comma before the asterisk, I would be unable to check if the last item in the list is a part of the filter due to it not having a comma after it. Would anything else work?

Thanks

Gysbert_Wassenaar
Not applicable

Re: Filter

Perhaps like this:

If(WildMatch([Fruit$.Fruit Type],

'*Apple,*',

'*Apple',

'*Orange,*',

'*Grape,*',

'*Pear*',), 'Tasty Fruits')


If(WildMatch([Fruit$.Fruit Type],

'*Lemon*',

'*Lime,*',

'*Apple Pear,*'), 'Decent Fruits')



talk is cheap, supply exceeds demand
Not applicable

Re: Filter

Thank you Gysbert!