Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
qluser01
Creator
Creator

Highlight a pie chart by expression - multiple pieces

Hi all!

I'm creating a comparison of each client answer vs all answers.

I have a client answer data below:

multiple answers to the question are possible:

Now when I select one CL_ID, I need to see on pie chart his/her answers colored:

But in fact I see only the first answer is colored, others are not.

For this selection (3) and (4) should be highlighted, not just (3).

Please help me to color all the answers of CL_ID selected.

See the sample file attached...

1 Solution

Accepted Solutions
OmarBenSalem

Your color conition is only about Q19_1ans, it's thus normal to have only Q19_1and being highlighted.

if ( index(Concat( Q19_ALL, ' '), Q19_1ans) >=1 and len(GetCurrentSelections())>0 , rgb(255, 0, 0), rgb(87, 87, 87))

If you want your condition to be about Q19_1ans, Q19_2ans,Q19_3ans change it as follow:

if ( index(Concat( Q19_ALL, ' '), Q19_1ans) >=1 and len(GetCurrentSelections())>0

or  index(Concat( Q19_ALL, ' '), Q19_2ans) >=1 and len(GetCurrentSelections())>0

or index(Concat( Q19_ALL, ' '), Q19_3ans) >=1 and len(GetCurrentSelections())>0 , rgb(255, 0, 0), rgb(87, 87, 87))

Result:

Capture.PNG

See the attached app :

View solution in original post

2 Replies
OmarBenSalem

Your color conition is only about Q19_1ans, it's thus normal to have only Q19_1and being highlighted.

if ( index(Concat( Q19_ALL, ' '), Q19_1ans) >=1 and len(GetCurrentSelections())>0 , rgb(255, 0, 0), rgb(87, 87, 87))

If you want your condition to be about Q19_1ans, Q19_2ans,Q19_3ans change it as follow:

if ( index(Concat( Q19_ALL, ' '), Q19_1ans) >=1 and len(GetCurrentSelections())>0

or  index(Concat( Q19_ALL, ' '), Q19_2ans) >=1 and len(GetCurrentSelections())>0

or index(Concat( Q19_ALL, ' '), Q19_3ans) >=1 and len(GetCurrentSelections())>0 , rgb(255, 0, 0), rgb(87, 87, 87))

Result:

Capture.PNG

See the attached app :

qluser01
Creator
Creator
Author

Cool, thanks!