avibrun
avibrun

Reputation: 39

Stacked bar chart in Qlik Sense

In QlikSense I am trying to create a stacked bar chart. My dataset is looks like:

Country  Type   Amount
Brazil   Cars   10
Brazil   Bus    15
Brazil   Bike   10
Canada   Cars   5
Canada   Bus    15
Canada   Bike   10
Egypt    Cars   5
Egypt    Bus    20
Egypt    Bike   5

And I would like a graph that looks like the following. However, I can't even select a stacked bar chart if I only add one measure, which is the Amount field. I think I should group by Country, should I also group by Type? Or should I add each Type as measure, is that possible and how can I do that?

Graph

Upvotes: 0

Views: 4554

Answers (1)

Stefan Stoychev
Stefan Stoychev

Reputation: 5022

You can easily create it in QS

  1. Add barchart object to your sheet
  2. press Add dimension button and pick Country field
  3. press Add measure button and pick Amount and then Sum(Amount)

    • at this point you will have chart that looks like this:

enter image description here

  1. From the properties panel on the right under Data --> Dimensions press Add button and pick Type field

enter image description here

  • now your chart looks like this:

enter image description here

  1. from the properties panel again Appearance --> Presentation --> and pick Stacked

enter image description here

  • and your chart will be stacked

enter image description here

Live chart here

Upvotes: 2

Related Questions