Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

100% Stacked bar chart

Hi,

Does anyone know how to create a '100% stacked bar' chart in a way, that tool compares the % not to the total, but to the reported groups? I.e.: sum(Product "X")=100%

Product "X"Product "Y"Product "Z"Grand Total
Approved1,427,075267,7171,189,9072,884,699
Rejected847,693765,022817,5932,430,308

And is it possible in any way to have both, the values and the % visible in the same chart? Or at least add the values into a % bar chart? Many thanks for your help!

4.PNG.png

Message was edited by: Prakash Pawar

1 Solution

Accepted Solutions
MarcoWedel

or maybe this one?

QlikCommunity_Thread_111482_Pic5.JPG.jpg

regards

Marco

View solution in original post

5 Replies
Not applicable
Author

Hey Prakash, can you attach a sample file if possible.

I think you can add another expression and make it text. Then you would have a bar in % and a value in text.

MarcoWedel

Hi Prakash,

maybe you find this solution helpful?

QlikCommunity_Thread_111482_Pic1.JPG.jpg

Chart Dimensions:

  1. Product
  2. Status

Chart Expression:

=sum(Value)/sum(Total<Product> Value)

The trick is to only total all chart dimension except the Product dimension, which in this case leaves only the Status dimension.

Load script:

CrossTable(Product, Value)

LOAD F1 as Status,

     [Product "X"],

     [Product "Y"],

     [Product "Z"],

     [Grand Total]

FROM

[http://community.qlik.com/thread/111482]

(html, codepage is 1252, embedded labels, table is @1);

QlikCommunity_Thread_111482_Pic2.JPG.jpg

I had to transform your table a bit (crosstable load).

Hope you don't mind

regards

Marco

srchilukoori
Specialist
Specialist

Chek the option 'values on data points' on the expression tab and also the 'Plot values inside the segments' in the presentation tab.

MarcoWedel

one more flexible way, using a calculated dimension that includes the rejected value:

=Product&chr(10)&num(aggr(Sum({$<Status={'Rejected'}>}Value), Product), '#,##0')

QlikCommunity_Thread_111482_Pic3.JPG.jpg

QlikCommunity_Thread_111482_Pic4.JPG.jpg

regards

Marco

MarcoWedel

or maybe this one?

QlikCommunity_Thread_111482_Pic5.JPG.jpg

regards

Marco