Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Look up values ​​in a field

How to search for specific text within a field that contains various information separated by commas ?

I set up a market research and multiple choice answers were built in the database by joining the Google Forms information and separating comma as the example . Need to separate the information . Thus , I thought to create three more columns that will function to search for text within a field and return it me or has not.

What your choice of colors : White , Black and Red ?WhiteBlackRed
Black, RedNotYesYes
White, BlackYesYesNot
White, Black, RedYesYesYes

Excel can result in using:


B2   =ISNUMBER(SEARCH("White";A2))

C2   =ISNUMBER(SEARCH("Black";A2))

D2   =ISNUMBER(SEARCH("Red";A2))

How to do this in Qlikview ?

Thanks.

Odair Jr.

Brazil

Labels (1)
6 Replies
Anonymous
Not applicable
Author

B2 For White

Pick(WildMatch(YourFieldName, '*White*) + 1, 'No', 'Yes')

C2 For Black

Pick(WildMatch(YourFieldName, '*Black*) + 1, 'No', 'Yes')

D2 For Red

Pick(WildMatch(YourFieldName, '*Red*) + 1, 'No', 'Yes')

morgankejerhag
Partner - Creator III
Partner - Creator III

A different approach - see the attached file.

if(SubStringCount(Colours,'Red'),'Yes','Not') as Red,

Anonymous
Not applicable
Author

This approach is cleaner.

Anonymous
Not applicable
Author

Thank you all for the answers . But I have another challenge.

And the color blue that was reported as a particular response and not listed in one answer arises?

Others need a column to manage the different colors of White , Black and Red.

What expression would the "Yes" results for Other column for Blue?

morgankejerhag
Partner - Creator III
Partner - Creator III

Here we handle unknown colors as well

purgechar(replace(replace(replace(Colours,'Red',''),'White',''),'Black',''),', ') as Other,

Anonymous
Not applicable
Author

Perfect Morgan , solved my problem.

Thanks.