Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart question - position of the Y axis

I have a combo chart that has three expressions (current value, target value and change).  For the first two expressions, I’m depicting them using a line.  For the third I’m using bars.  I’d like to get the expression axes for the third expression to display on the left.  The other two are on the right.  I’m looking at the axes tab in the chart properties but I don’t see how to make this happen.  Is this possible?  I’m attaching an example of what I would like it to look like.

Thanks in advance.

9 Replies
johnw
Champion III
Champion III

On the Axes tab, click on an expression, then in the Position box to the right, select which axis you want it to use.  Do the same for the other two expressions.

Not applicable
Author

I tried that.  I'm attaching a screenshot of my current chart and the properties.  The Change expression's position is set to Left (Bottom) but it is appearing on the right.


Img1.bmp

Img4.bmp

johnw
Champion III
Champion III

Uncheck "Split Axis".  Splitting tells it to put it on the bottom instead of on the left.

Not applicable
Author

Is it possible to have the third expression on the left but also in the lower half of the chart?  Changing the position to Left (Bottom) does move it to the left but I need it towards the bottom, not on the same scale as the expressions on the right.  I tried clicking Split Axis but this moved the axis back over to the right.

Screenshot of chart after clicking on Position = Left (Bottom) on third expression.

Img6.bmp

Img5.bmp

Example of what I am trying for:

Img7.bmp

johnw
Champion III
Champion III

You can indeed put it in the lower half of the chart, but you're going to need additional calculations to get there.  Notice the "scale" box.  You need to calculate a "static" max and min so that the bars show up only in the lower half or third of your chart.  This will probably be of the following general form:

static min = rangemin(0,min(aggr(Expression,Dimension)))
static max = (1/Percent)*rangemax(0,max(aggr(Expression,Dimension))) - (1/percent-1)*rangemin(0,min(aggr(Expression,Dimension)))

Expression is the expression you're using for the bars.  Dimension is your chart's dimension.  Percent is the percent of the total chart you want your bars to cover.  Eyeballing what you have, maybe 30%?  Put it in as 0.3, though, because QlikView doesn't like numbers entered as %.  It will give you a scale all the way to the top, but the bars themselves will be limited in size.  The rangemax() and rangemin() make sure that zero is always displayed.  Yes, the forced 0 does that as well, but would result in a different percent of the graph being used.  Calculating it yourself makes sure it's always the right percent.

Edit: To avoid repeating your expression four times if it's anything complicated, you might want to store it in a variable.  You might want to do that anyway so that people maintaining the chart later don't change your expression and forget to change your min and max.  If it's a simple expression, though, a comment that the min and max need to be kept in sync would probably be sufficient, and is probably what I'd do.

Not applicable
Author

This is what I am ending up with:

Img8.bmp

Img9.bmp

Maybe my syntax is incorrect:

=rangemin(0,min(aggr(Change,Dates)))

=(1/0.3)*rangemax(0,max(aggr(Change,Dates))) - (1/0.3-1)*rangemin(0,min(aggr(Change,Dates)))

johnw
Champion III
Champion III

I don't believe you can refer to the NAME of the expression when calculating the scale.  I think you need to repeat the expression.  That's why I mentioned using a variable if it's a complicated expression that you don't want to write and maintain four times.

Not applicable
Author

I don't think this is going to work.  The expression I'm using for Change is using a () below function to get to the previous expression value. 

The expression is:

column(1)-above(column(1))

johnw
Champion III
Champion III

Use a variable for the first expression as well, then use $(Variable)-above($(Variable)) instead, or just repeat the first expression if it's a simple one.

See attached working example.