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 - 1 dimension, 2 expressions

Hello everyone,

Simple question I hope.  I have 1 dimension (AGE) and two expressions.  When I turn my table into a stacked bar chart it stacks the expressions witht the dimension on the x-axis.  What I want is the two expressions as bars stacked by the age groups in the dimension (i.e. I need to flip it)

How do I do this?  I can't find a setting to flip it.

Cheers,

Gareth

14 Replies
prieper
Master II
Master II

Go to Properties -> Style -> Subtype and choose "Stacked"

HTH
Peter

Not applicable
Author

Hi Peter,


Thanks for your example, although it is the wrong way around.  I have a single dimension and two expressions.  I need the expressions on the x axis and the stacking 'factor' to be the dimension (AGE).

So in your example, Sum(Persons) would be one expression and perhaps Count(Persons) is another expression with a single dimension of AGE.

See the attached, I need the age to be the stack and the expressions to be the bars.  Opposite to what I've got in the example.

Thanks

Gareth

prieper
Master II
Master II

Can you draw it and post it?

Or do you need to have the bars horizontally?

Peter

attachment added

Not applicable
Author

Here is an example of what I mean with the Dimension of GENDER where the two expressions are on the x axis and the dimension is the stacking factor.

example.png

Thanks

Gareth

prieper
Master II
Master II

Like the attached?

Peter

Not applicable
Author

Thanks for your reply again Peter.

Unfortunately your example remains a 2x dimension 1x expression.  I need to show one with 1x dimension (AGE) and 2xexpressions side-by-side.

Thanks

Gareth

erichshiino
Partner - Master
Partner - Master

Hi, Gareth

I tried something with valuelist(). Basically I created a dummy dimension, the multiple expressions as an if statement within the single expression I have.

Hope this can help,

Erich

Not applicable
Author

Thanks mate, this is a clever workaround!

Cheers

G

Not applicable
Author

Hello i was wondering if anyone could help me with a problem.

I am trying to stack a bar cahrt with two dimensions and one expression.

The reason for this is because i have a list box which allows me to select 1+ feilds, which are then displayed on the chart according to the dimensions. I can get the bars to stand side by side and horizonaly, but they take up to much space, i cant get them to stack.

When i go into properties and change the style to stacked the data disappears, however if i put it on a line graph the data is displayed as a number of different lines and works, unfortunatly i need it as a bar chart.

Any ideas how i could do this? or if it can even be done?