Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
The answer is in the title of your question ... almost
See function wildmatch()
Regards,
Michael
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
That worked perfectly.
Thanks for the speedy reply.
-Ming