Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Stacked bar chart with set analysis and multiple expressions

Is there a possibility to use the stacked bar chart with multiple expressions?

I want to show three values of an age dimension, each value has an 100% total (I don't want to see the ratio between the age values ), with the stacked bar chart devided in male / female.

error loading image

I use gender as dimension and use set analysis with three expressions:

  • count(distinct {$ < age={'0 t/m 5 jaar'} >} cases)
  • count(distinct {$ < age={'10 t/m 15 jaar'} >} cases)
  • count(distinct {$ < age={'20 t/m 35 jaar'} >} cases)

When I do this, Qlikview won't show the values in a stacked bar. If I use the option stacked bar QV shows the bar chart grouped. Maybe a bug or are there other solututions?

1 Solution

Accepted Solutions
Not applicable
Author

I don't think you need Set Analysis or even three expressions to create this chart.

Stacked bar charts can be built using two dimensions. On for each bar and the other to split the bar. In your case, you want Age Group and then Gender.

For the expressions, use:

Count (Case)/Count(TOTAL <Age> Case)


That will get you the number of cases for each gender & age group, divided by the total number of cases for that age group (the TOTAL ignores all dimensions, while the <Age> aggregates by Age). I've attached a sample.

View solution in original post

2 Replies
Not applicable
Author

I don't think you need Set Analysis or even three expressions to create this chart.

Stacked bar charts can be built using two dimensions. On for each bar and the other to split the bar. In your case, you want Age Group and then Gender.

For the expressions, use:

Count (Case)/Count(TOTAL <Age> Case)


That will get you the number of cases for each gender & age group, divided by the total number of cases for that age group (the TOTAL ignores all dimensions, while the <Age> aggregates by Age). I've attached a sample.

Not applicable
Author

thanks! works great