Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

reivax31
Contributor III

Function NOT LIKE

Hi Qlikers,

I'm trying to find a way to do a "NOT LIKE"  function. But it seems it doesn't exist like that in the tool. This is what I do when I want to use the Like Function:

[Dimension] like '*test*'

Someone has an idea about how to do the opposite?

Thanks for your help!

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Function NOT LIKE

May be the logic would be like:

IF(Not WILDMATCH(Dimension, '*CAT1*'), if([Dimension] like '*CAT*'), count(ref))

Better would be using set analysis like:

Count({<Dimension = {'CAT*'} - {'CAT1*'}>}ref)

6 Replies
igdrazil
Contributor III

Re: Function NOT LIKE

Hi Xavier,

Try Something like this:

IF(WILDMATCH(Dimension, '*test*'), SomethingHappens, SomethingElseHappens)

Regards

Chris

MVP
MVP

Re: Function NOT LIKE

'Like' operator is available in qv as well. you can try with wildmatch() too.

reivax31
Contributor III

Re: Function NOT LIKE

Hi,

Thanks for your quick answers. I'm trying to do it in the front end. I tried also a few things with wildmatch but no success.

Lets says my dimension can have a value like "XXXXX CAT CAT1 XXXXX". I'm trying to count all the values that have CAT but not CAT1 (for information, If there is CAT1 you always have CAT). So when I use the Like function if I want to do [Dimension] like '*CAT*' and [Dimension] notlike '*CAT1*'

With wildmatch:

IF(WILDMATCH(Dimension, '*CAT1*'), ?DONOTHING?, if([Dimension] like '*CAT*'), count(ref))

Is it possible to ask to DONOTHING? what should I put?

Thanks for your support

MVP
MVP

Re: Function NOT LIKE

May be the logic would be like:

IF(Not WILDMATCH(Dimension, '*CAT1*'), if([Dimension] like '*CAT*'), count(ref))

Better would be using set analysis like:

Count({<Dimension = {'CAT*'} - {'CAT1*'}>}ref)

MVP
MVP

Re: Function NOT LIKE

What about

not Dimension like '*test*'

reivax31
Contributor III

Re: Function NOT LIKE

Thanks a lot Tresesco!

The set analysis version works perfectly. I guess I have to look more in that type of expression for my next créations.

Best regadrs and have a nice day!