Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Luigi_Qlik
Contributor
Contributor

Stacked Bar Charts & Dimensions

Hello all!

I'm working on a stacked bar chart which aims to provide two sets of related data. Not sure how to achieve this though.

Let's say the aim is to provide view of 'Predicted Sales' and 'Actual Sales' across 3 types of Products (Bakery, Canned Goods and Frozen Foods), the result being 6 bars with 'Predicted Sales' to one side and 'Actual Sales' to the other.

 

Dimension

What I have so far is something like:

=IF(MATCH(Product,'Bakery'),'Bakery',IF(MATCH(Product,'Canned Goods'),'Canned Goods',IF(MATCH(Product,'Frozen Foods'),'Frozen Foods')))

This will give me 3 bars. I'm not sure how to add in Fields [Predicted Sales] and [Actual Sales] in to this to split them out, result in 6 bars. No doubt an AND statement is missing, but again unsure how to apply.

 

Measures

I have a multiple measures which then create the stacked volumes using code like:

Bakery: SUM({[Produce]={'Bread','Pastry','Cake',}}[Actual Sales])

Canned Goods: SUM({[Produce]={'Beans','Peas','Soup'}}[Actual Sales])

Frozen Foods: SUM({[Produce]={'Frozen Vegetables','Ice Cream','Frozen Pizza',}}[Actual Sales])

 

I'll need to add the same again for [Predicted Sales] once the Dimension is updated to handle it. For now they only add to the existing 3 bars if I do. Any suggestions?

1 Reply
Brett_Bleess
Former Employee
Former Employee

Generally to receive help on these types of questions, you will need to submit a sample QVW file/application such that the Members can see the actual data model and expressions being used to try to assist in providing ideas on how to go about things.  Without the additional information, it is less likely you will get the help you want.  

The best area to which I could point you to look around would be the Design Blog area:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

You may be able to find some posts there that will put you on the right track.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.