Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bar chart count and percentage

Friends,

I want to create a bar chart which displays both count and its percentage and I'm using the below expressions for

1. Count(DISTINCT {<Maersk={'Y'}>}[Field Name])/Count(DISTINCT{$<[Carrier Name]={'Y'}>}[Field Name]) - percentage

2. Count(DISTINCT {<Maersk={'Y'}>}[Field Name]) - count of fields

The chart should be as below,

Screenshot_2.png

In the above chart, I can only able to show percentage but not the count. So, please help me guys to show both count and percentage in a single bar chart.

1 Solution

Accepted Solutions
buzzy996
Master II
Master II

pfa,if u looking for the same ? u have write total syntax on ur expression tab.

View solution in original post

13 Replies
Not applicable
Author

Hi Siva,

By using two expressions you will get two bars for two expressions, you can select the relative option for one expression to show the % or if you are using stacked bar the second bar value will add to the first one and give you the total value as %.

Maybe someone here can give you the better answer

adamdavi3s
Master
Master

Hi,

You can do this using the DUAL function

So something like this (Sorry for any typos)

DUAL(num(Count(DISTINCT {<Maersk={'Y'}>}[Field Name])/Count(DISTINCT{$<[Carrier Name]={'Y'}>}[Field Name]) ,'0.00%'), Count(DISTINCT {<Maersk={'Y'}>}[Field Name]) )

I've attached an example

Capture.PNG

Anonymous
Not applicable
Author

Thanks Adam, but it's not showing the count of fields...

adamdavi3s
Master
Master

Hi Siva,

What is it showing?


Adam

Anonymous
Not applicable
Author

It displays only the percentage value but the count of fields is shown in y-axis, I need the count to be shown atleast on hovering it.

Screenshot_5.png

buzzy996
Master II
Master II

pfa,if u looking for the same ? u have write total syntax on ur expression tab.

adamdavi3s
Master
Master

Hmmm that is weird, I'd need to see your file to work it out really, but I suggest something isn't quite right with the formula.

Can you upload your file?

sunny_talwar

May be like this (using Adam's sample)

Capture.PNG

Capture.PNG

Anonymous
Not applicable
Author

Thanks guys, I got it....