Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
What about
If(Len(GetFieldSelections(searchField))>0 and index(GetFieldSelections(searchField), MemoText) > 0, '<B>')
?
You can also try this with SubStringCount here:
If(Len(GetFieldSelections(searchField))>0 and SubStringCount(GetFieldSelections(searchField), MemoText) = 1, '<B>')
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.
The problem is the same as for swuehl's response: The searchField contains single words and the other Field a whole sentence.
Maybe something like
If(Len(GetFieldSelections(searchField))>0 and WildMatch(MemoText, $(=Concat(DISTINCT chr(39) &'*'&searchField& '*'&chr(39),',')) ) > 0, '<B>')