3 Replies Latest reply: Aug 25, 2017 5:55 AM by Sunny Talwar

# Drawing a bar graph with a difference

Evening all

I would appreciate some assistance with drawing a bar graph with a bit of a difference. Our customer fill in a questionnaire where there are some questions asking for a Yes/No response around their health status. There a question that asks if they have diabetes, another that asks if they have hypertension, another one that asks if they have high cholesterol, etc. I want to represent this in a bar graph where each bar on the graph will be for each question that was answered. The bar will simply show the percentage of customers that answered Yes for that question. In this example I will have a bar graph with 3 bars, one for diabetes, then next for hypertension and the last for high cholesterol. Each bar will show the percentage of customers that answered Yes to that question.

The input data would look like this (I have excluded the other fields that are not relevant to this question)

Customer NoDiabetesHypertensionHigh Cholesterol
1YesNoYes
2NoYesYes
3NoNoYes
4NoYesNo
5YesYesNo
6NoYesNo

The bar graph's 3 bars would have the values, Diabetes:33.3%, Hypertension:66.7% and Cholesterol:50.0%

You suggestions will be most welcome.

Braham Edwards

• ###### Re: Drawing a bar graph with a difference

Create a bar chart with no dimension and three expressions

1) Count({<Diabetes = {'Yes'}>}Diabetes)/Count(Diabetes)

2) Count({<Hypertension = {'Yes'}>}Hypertension)/Count(Hypertension)

Count({<[High Cholesterol] = {'Yes'}>}[High Cholesterol])/Count([High Cholesterol])

• ###### Re: Drawing a bar graph with a difference

Thanks Sunny, I did not know you could draw a bar chart without any dimension.

Works fine.

Regards

Braham

• ###### Re: Drawing a bar graph with a difference

In QlikView, you can.... but not so sure about Qlik Sense