Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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