Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
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 @vannuffelgert 

1 Solution

Accepted Solutions
jwjackso
Specialist II
Specialist II

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 II
Specialist II

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

barnabyd
Partner
Partner

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