Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

qluser01
Contributor

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
Highlighted
Partner
Partner

Re: Highlight a pie chart by expression - multiple pieces

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 :

2 Replies
Highlighted
Partner
Partner

Re: Highlight a pie chart by expression - multiple pieces

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
Contributor

Re: Highlight a pie chart by expression - multiple pieces

Cool, thanks!