Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

string comparison and wildcard question, Like and Not Like operator

I'm very new to Qlikview,

I have an if statement in my load script from  sql table , but am having trouble getting the wildcard string comparisons to work.

This is what I have, but it is not matching the '%' to 0 or more characters before or after the string 'events'.

   if (( Medium Like '%events%'  ), 'PREvents', 'Other') as channel

Also: Is there something that is equivalent  to ' NOT LIKE'  I like to be able to have a condition based on something that does not contain a string.

if (( Medium NOT Like '%viral%'  ), 'Direct', 'Other') as channel

Thanks.

-Ming

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I think you are looking for the wildcard character * (any number of arbitrary characters):

      if ( Medium Like '*events*', 'PREvents', 'Other') as channel


and not like should be like


     if ( not Medium Like '*viral*', 'Direct', 'Other') as channel


View solution in original post

3 Replies
Anonymous
Not applicable
Author

The answer is in the title of your question ...  almost

See function wildmatch()

Regards,

Michael

swuehl
MVP
MVP

I think you are looking for the wildcard character * (any number of arbitrary characters):

      if ( Medium Like '*events*', 'PREvents', 'Other') as channel


and not like should be like


     if ( not Medium Like '*viral*', 'Direct', 'Other') as channel


Not applicable
Author

That worked perfectly.

Thanks for the speedy reply.

-Ming