Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

chart and expression help

Hi,

We have a chart that is showing responses to a question 'treated with respect'.

For the purposes of the chart we only want to show yes and no responses and exclude 'not answered'. So we have the following expression which works fine:

({<[PI4 Treated with Respect YN] = {'Yes'}>} [PI4 Treated with Respect YN]) + Count({< [PI4 Treated with Respect YN]= {'No'}>} [PI4 Treated with Respect YN])

However, we want to show these figures (300 = yes, 10 no) in percentage format on the chart. This is what we are struggling with...

We have tried this for example but doesn't work.

({<[PI4 Treated with Respect YN] = {'Yes'}>} [PI4 Treated with Respect YN]) + Count({< [PI4 Treated with Respect YN]= {'No'}>} [PI4 Treated with Respect YN])
/
Count(TOTAL{<[PI4 Treated with Respect YN] = {'Yes'}>} [PI4 Treated with Respect YN]) + Count(TOTAL{<[PI4 Treated with Respect YN] = {'No'}>} [PI4 Treated with Respect YN])

Any help would be greatly appreciated.

Chris

3 Replies
datanibbler
Champion
Champion

Hi,

the TOTAL operator only ignores chart_dimensions.

What you want to do is compare the YES-answers to the total of all answers and the NO answers in relation to the total of answers, no?

So the first part has to be only one of those parts, not both. And you can remove the TOTAL as it doesn't help you in this instance.

Apart from that, it does look fine as far as I can see.

HTH

Best regards,

DataNibbler

nagaiank
Specialist III
Specialist III

Use the following expressions:

Count({< [PI4 Treated with Respect YN]= {"Yes"}>} [PI4 Treated with Respect YN]) / Count({< [PI4 Treated with Respect YN]= {"Yes","No"}>} [PI4 Treated with Respect YN])


Count({< [PI4 Treated with Respect YN]= {"No"}>} [PI4 Treated with Respect YN]) / Count({< [PI4 Treated with Respect YN]= {"Yes","No"}>} [PI4 Treated with Respect YN])

Not applicable
Author

Hi,

We want it to calcuate % of No's and Yes' compared to all Yes and No responses after its excluded the 'not answered':

40 Not answered

300 No

10 Yes

Total responses 310 for the purpose of this calculation

Chris