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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
AshwiniKa
Contributor
Contributor

How to create stacked plus grouped bar chart in Qiksense

I have two products , each product has 3 measures related to it and Month as a dimension.

I want to create a bar chart where i want to show the  stacked bars for each product for same month.n short i want to combine the grouped as well as stacked bars in same Graph.

Can anyone help me here?

 

 
Labels (1)
4 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Ashwinika,

Good request, but this is currently not possible with the charts that are available in Qlik Sense.

Jordy

Climber

Work smarter, not harder
Danica-Cortez
Contributor II
Contributor II

It is possible to do a stacked bar chart with multiple categories for a side-by-side comparison by month and year. An example image I found is below.

  • Combo chart with month (Jan, Feb, March) as the bar dimension
  • Create a separate measure for each category and year with set analysis
    • Example Category 1:
      • Sum({$<Year={},Year={'$(vLastYear)'},[Category] = {'Cat1'}>} [Value])
      • Sum({$<Year={},Year={'$(vCurrentYear)'},[Category] = {'Cat1'}>} [Value])
    • Example Category 2:
      • Sum({$<Year={},Year={'$(vLastYear)'},[Category] = {'Cat2'}>} [Value])
      • Sum({$<Year={},Year={'$(vCurrentYear)'},[Category] = {'Cat2'}>} [Value])
    • Continue with every category
  • Change the axis for all measures related to last year to secondary axis, all measures related to the current year should be on the primary axis
    • Example Category 1:
      • Sum({$<Year={},Year={'$(vLastYear)'},[Category] = {'Cat1'}>} [Value]) -> more properties -> change to secondary axis
      • Sum({$<Year={},Year={'$(vCurrentYear)'},[Category] = {'Cat1'}>} [Value]) -> more properties -> change to primary axis
  • Since the measures will be on different axes, the ranges of the y-axes need to be synched
    • Go to y-axis properties for both primary and secondary
    • Change range from Auto to Min/Max 
      • Min: Min(Aggr(Sum( {$<Year={},Year={'$(vLastYear)','$(vCurrentYear)'}>} [Value]), [Month Year]))
      • Max: Max(Aggr(Sum( {$<Year={},Year={'$(vLastYear)','$(vCurrentYear)'}>} [Value]), [Month Year]))

For the maximum to work with filters, you can do an if statement to round to the nearest whole value instead of the straight up maximum. For example, if users need to filter for a specific account that has very little sales, the maximum on the y-axes will round up to the nearest 10th, 100th, 1000th, etc. depending on the filters.

If(
Max(Aggr(Sum( {$<Year={},Year={'$(vLastYear)','$(vCurrentYear)'}>} [Value]), [Month Year])) < 9,
    Ceil(Max(Aggr(Sum( {$<Year={},Year={'$(vLastYear)','$(vCurrentYear)'}>} [Value]), [Month Year])), 10),
    
If(
    Max(Aggr(Sum( {$<Year={},Year={'$(vLastYear)','$(vCurrentYear)'}>} [Value]), [Month Year])) < 9999,
    Ceil(Max(Aggr(Sum( {$<Year={},Year={'$(vLastYear)','$(vCurrentYear)'}>} [Value]), [Month Year])), 1000)....
etc.
 

 

 

 

DanicaCortez_1-1764025695577.png

 

 

kumarnatarajan
Partner - Specialist
Partner - Specialist

Nice try @Danica-Cortez 

For a more dynamic and customizable option, try the SenseOps Combo Chart, which includes 3 Dimensions stacked support. See the attached sample for reference.

kumarnatarajan_0-1764052971986.png

 

Danica-Cortez
Contributor II
Contributor II

Ah that's amazing! Unfortunately 3rd party viz are managed by my org and are heavily limited.