Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
tomf122
Contributor III
Contributor III

Combo bar Chart with two measures and two dimensions

Hey, 

I am looking for a way to create a bar chart which has two measures and two dimensions. 

Currently my chart has one measure but I would also like to add the target beside the current chart. I have had a look through the forums but cant see anything where two measures and dimensions can be combined. 

Current:

tomf122_0-1651743539284.png

 

Chart done in excel which I'm trying to replicate. 

tomf122_1-1651743572778.png

Thanks,

Tom

Labels (1)
3 Replies
vinieme12
Champion III
Champion III

Yes this is achievable

Dimension 1 :  X - Axis   , Just combine your dimensions using a calculated dimension

Aggr(MonthYear&'-'&Type,MonthYear,Type)    << Assuming Type field has values Target & Achieved

Dimension 2: simply the dimension values you want to see stacked

Measure = Sum(Sales)

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
edwin
Master II
Master II

you actually need to take it one step further.  instead of AGGR in the dimension, you should create a dual which is the concat of the month and type (target or actual) and the number part which allows you to sort it properly.  if you dont youll have a hard time ordering JAN, FEB, MAR...

also in the dim you dont need the aggr.  you will get the same result.  what is key here is the color:

Screen Shot 2022-05-06 at 4.27.01 PM.png

 for example i used DIM - A,B,C:

=if(type='TARGET',pick(match(dim,'A','B','C'),ARGB(100,200,0,0),ARGB(100,0,200,0),ARGB(100,0,0,200)),

pick(match(dim,'A','B','C'),ARGB(200,200,0,0),ARGB(200,0,200,0),ARGB(200,0,0,200)))

but you should be able to find a more dynamic way of assigning color and alpha value

vinieme12
Champion III
Champion III

"if you dont youll have a hard time ordering JAN, FEB, MAR.."

You can sort by expression

under sorting >> sort by Expression >> =MonthNum

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.