Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
klrameet
Contributor III
Contributor III

100% Stacked Bar Chart using multiple measures

i am trying to plot a 100% stacked bar chart, showing the variance across three categories for each group and it was relatively automatic and easy in excel to plot .. 

Capture.PNG

 

 

 

 

but when i tried to same in qlik sense .. this is what i am getting, i tried using total function but still no luck.

sum([Taken])/sum(TOTAL<Group> [taken])

sum([Planned])/sum(TOTAL<Group> [Planned])

sum([Open])/sum(TOTAL<Group> [Open])

Capture2.PNG

 

Any pointers would be helpful

@JonnyPoole @Anonymous 

Labels (4)
1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

Using the following data:

Data:
Load * Inline [
Code,TAKEN,PLANNED,BALANCE
ABC,10,50,10
DEF,12,12,56
GHI,5,5,14
];

Formula for % TAKEN

=Sum(TAKEN)/(SUM(TAKEN)+SUM(PLANNED)+SUM(BALANCE))

Formula for % PLANNED

=Sum(PLANNED)/(SUM(TAKEN)+SUM(PLANNED)+SUM(BALANCE))

Formula for % BALANCE

=Sum(BALANCE)/(SUM(TAKEN)+SUM(PLANNED)+SUM(BALANCE))

Set the presentation to be a stacked  bar chart

stackedbarchart.PNG

View solution in original post

2 Replies
jwjackso
Specialist III
Specialist III

Using the following data:

Data:
Load * Inline [
Code,TAKEN,PLANNED,BALANCE
ABC,10,50,10
DEF,12,12,56
GHI,5,5,14
];

Formula for % TAKEN

=Sum(TAKEN)/(SUM(TAKEN)+SUM(PLANNED)+SUM(BALANCE))

Formula for % PLANNED

=Sum(PLANNED)/(SUM(TAKEN)+SUM(PLANNED)+SUM(BALANCE))

Formula for % BALANCE

=Sum(BALANCE)/(SUM(TAKEN)+SUM(PLANNED)+SUM(BALANCE))

Set the presentation to be a stacked  bar chart

stackedbarchart.PNG

barnabyd
Partner - Creator III
Partner - Creator III

Here's another solution. It might not be suitable, but it's good to know that it's available.

Use crosstable to convert the three columns into another dimension and then you have two dimensions and only one measure on your stacked bar chart.

barnabyd_0-1598831315417.png

Then you only need one formula:

=Sum(Value) / sum( total<Code> Value )

barnabyd_1-1598831433602.png

 

Barnaby Dunn
BI Consultant