Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
manisha10
Contributor III
Contributor III

How to create a stacked bar chart coming from 2 tables - Qlik sense

Hi All! 

I have a two tables. I have created stacked bar chart from 1 table. I want to add one more on this stacked bar chart and the amount is coming from a different table. 

manisha10_0-1632381448504.png

Stacked bar chart from table 1: 

manisha10_1-1632381472191.png

Desired Output: 

manisha10_2-1632381522587.png

 

Thank you!

Qlik Sense Business 

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

Hi , 

the bar chart has this limitation : 
you can either use 2 dimensions and 1 measure or 1 dimension and as many measures you want. 
you have 2 options: 
1 concatenate the two tables in the load script : 

Table1:
Load Month,
     [Asset class],
     Amount
From XXX;
concatenate (Table1)
Load Month,
     'Others' as [Asset class]
      [Total Amount] as Amount
From YYY;

Then you'll have a simple chart :
1st dimension: Month
2nd dimension:  Asset class
measure: Sum(Amount)
your second option is to leave the table as they are and to build this chart. 
dimension: Month

1st measure: sum(if([Asset class]='A', Amount)

2nd measure: sum(if([Asset class]='B', Amount)

3rd measure: sum([Total Amount])

View solution in original post

2 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi , 

the bar chart has this limitation : 
you can either use 2 dimensions and 1 measure or 1 dimension and as many measures you want. 
you have 2 options: 
1 concatenate the two tables in the load script : 

Table1:
Load Month,
     [Asset class],
     Amount
From XXX;
concatenate (Table1)
Load Month,
     'Others' as [Asset class]
      [Total Amount] as Amount
From YYY;

Then you'll have a simple chart :
1st dimension: Month
2nd dimension:  Asset class
measure: Sum(Amount)
your second option is to leave the table as they are and to build this chart. 
dimension: Month

1st measure: sum(if([Asset class]='A', Amount)

2nd measure: sum(if([Asset class]='B', Amount)

3rd measure: sum([Total Amount])

manisha10
Contributor III
Contributor III
Author

Hi @lironbaram thank you for the solution!! I used combo chart and added 3 measures with 3 different colours.