Qlik Community

Qlik Sense Cloud Discussions

New Contributor III

Stacked Bar Chart

I have a a stuff that I want to have this way but I am finding it difficult to achieve. It has eaten off my 36 hours.

I want it to display percentage of total inside  each segment like the one in the picture.

Thank you all in advance.

1 Reply
Honored Contributor

Re: Stacked Bar Chart

Try to change your expressions like:

You would do this with the TOTAL function, so if your expression is sum(Value) percentage would be:

sum(Value) / sum(TOTAL Value)

Where the TOTAL causes the divisor to calculate across all dimensions.  If you have two dimensions in your chart (say in a Pivot) you can do the total across a second dimension:

sum(Value) / sum(TOTAL <Dimension> Value)

If you want to ignore selections on a certain field (so you always look at the total, not the total of selected items) you can use set analysis to ignore some selections in the total:

sum(Value) / sum({<Dimension=}>} TOTAL Value).

After this, change the Appearance options of Bar chart.