Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
SerSwagster
Creator
Creator

Checking multiple values in a string

Hi everyone,

I want to know if it is possible to check the presence of multiple "values" within a string.

This is my case. I have a column called COLORS filled with these records (each of them is a singular string):

green,blue

red,green

red,blue,yellow

yellow,blue,red

yellow,red,blue,green

green,red,blue

...

If I want to control that a specific color (e.g. green) is not present in the string, I do this:

if(not wildmatch(COLOR, '*green*'), 'check', 'ok')

What should I do to control multiple colors in the same string? I can't do like this ('*green,blue*') because sometimes the values are written in a different order and so the string is different.

Any suggestion?

13 Replies
rwunderlich

I got my parens in the wrong place

if(WildMatch(COLOR,'*yellow*','*orange*','*green*','*red*','*blue*')
and not WildMatch(COLOR,'*yellow-*') , 'check', 'ok')

-Rob

SerSwagster
Creator
Creator
Author

It still give me no result.

rwunderlich

Can you post some sample data and the results you are seeing?

-Rob

SerSwagster
Creator
Creator
Author

I have solved the issue in this way. Anyway, thanks a lot.

if(Left(NAME, 5) = '2019_' and WildMatch(COLOR,'*yellow-orange*','*green-blue*'.), 'check',
if(Left(NAME, 5) = '2022_' and WildMatch(COLOR,'*yellow,*','*yellow','*orange,*','*green*','*red*','*blue*'), 'check', 'ok'))