Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Check if Field contains any of GetFieldSelections substrings

I want to create a conditional chart that highlights values selected values from a listbox by making them bold.

The values in this listbox are not connected to the chart data (otherwise it would change the data).

While the format of the text shouldnt be the problem (just a '<B>' in text format), i encounter some problems as soon as the listbox contains multiple values. Take a look at my current expression below.

If(Len(GetFieldSelections(searchField))>0 and index(MemoText,GetFieldSelections(searchField)) > 0, '<B>')

This does work for one item, but as GetFieldSelections for multiple selections contains a comma delimited string of the selected values it finds no match anymore. In other languages i would split it by comma and make a for-loop but as far as i know QlikView doesnt have these possibilities.

Thanks for your help in advance!

5 Replies
swuehl
MVP
MVP

What about

If(Len(GetFieldSelections(searchField))>0 and index(GetFieldSelections(searchField), MemoText) > 0, '<B>')


?

sunny_talwar

You can also try this with SubStringCount here:

If(Len(GetFieldSelections(searchField))>0 and SubStringCount(GetFieldSelections(searchField), MemoText) = 1, '<B>')

Not applicable
Author

That doesnt work. Imagine the searchField containing the values "Ice, Fire, Wind" and the Field MemoText containing "I prefer Wind". You cant search for the whole phrase.

Not applicable
Author

The problem is the same as for swuehl's response: The searchField contains single words and the other Field a whole sentence.

swuehl
MVP
MVP

Maybe something like

If(Len(GetFieldSelections(searchField))>0 and WildMatch(MemoText, $(=Concat(DISTINCT chr(39) &'*'&searchField& '*'&chr(39),',')) ) > 0, '<B>')