9 Replies Latest reply: Nov 9, 2011 2:30 PM by John Witherspoon RSS

    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.

        • Chart question - position of the Y axis
          John Witherspoon

          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.

            • Chart question - position of the Y axis

              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

                • Chart question - position of the Y axis
                  John Witherspoon

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

                    • Chart question - position of the Y axis

                      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

                        • Re: Chart question - position of the Y axis
                          John Witherspoon

                          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.