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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Offset X-axis to 1

I want to create a chart with values on Y-axis from 0 to 10 but I need to have the X-axis starting at 1. This means that some of the values will show as 0.25 or 0.9, etc below the X-axis. Does Qlikview has a way to offset the X-axis? Attaching a sample chart.

10 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Interesting... To the best of my knowledge, - no, not out of the box. I haven't seen any settings that could help you move the Axis up by a certain amount...

I'd say - it would take a lot of tricky work-around solutions to get this chart, or - if you are using ver. 10.0, perhaps you can find a JScript solution and integrate it as an Extension Object...

vgutkovsky
Master II
Master II

Correction: you mean offset the Y-axis to be aligned at X=1. The X-axis itself is not offset. As far as I know, you can't change the positions of the axes themselves. But if your X goes into negatives, then the chart will certainly display that if you don't restrict it with a static min. It's just that the Y-axis will remain on the left side of the screen. By the way, you might get a smoother effect if you set the X-Axis to Continuous in the Axes tab, since it sounds like your X-axis is actually a number.

Regards,

johnw
Champion III
Champion III

Subtract 1 from the ratio, THEN on the expressions tab, click on the little + next to the expression, click on Bar Offset, and enter 1. For the axis, go to the presentation tab, click "Add" in the Reference Lines section, and enter 1 for the expression. See attached.

Edit: Added dual() to the expression so that it would display the right number when you mouse over, instead of the number - 1.

johnw
Champion III
Champion III

Grrr... the forum is INSISTING on keeping my old attachment in the above post, no matter how many times I replace it. See attached for the fixed version

Not applicable
Author

Thank you so much John. This is absolutely brilliant.

I managed to offset the X-axis to 1 by using the solution you have provided. I am having trouble with the dual function though. Not sure what I am doing that is not correct. The results I am getting for the values below the X-axis are not correct. For example, where I should have a 0.38. Instead I am getting a -0.62 OR where I should have 0.9, it is showing up as -0.1

This is the expression I am using. Can you help me figure out what might be the problem:

dual(sum(if(DateFlagCurrQTD=1 or DateFlagPrevQTDMinusZero=1 or DateFlagPrevQTDMinusOne=1 or DateFlagPrevQTDMinusTwo=1 or DateFlagPrevQTDMinusThree=1,BOOKING_AMT/1000))/
sum(if(DateFlagCurrQTD=1 or DateFlagPrevQTDMinusZero=1 or DateFlagPrevQTDMinusOne=1 or DateFlagPrevQTDMinusTwo=1 or DateFlagPrevQTDMinusThree=1,REVENUE_AMT/1000)),
sum(if(DateFlagCurrQTD=1 or DateFlagPrevQTDMinusZero=1 or DateFlagPrevQTDMinusOne=1 or DateFlagPrevQTDMinusTwo=1 or DateFlagPrevQTDMinusThree=1,BOOKING_AMT/1000))/
sum(if(DateFlagCurrQTD=1 or DateFlagPrevQTDMinusZero=1 or DateFlagPrevQTDMinusOne=1 or DateFlagPrevQTDMinusTwo=1 or DateFlagPrevQTDMinusThree=1,REVENUE_AMT/1000))-1)

johnw
Champion III
Champion III

I don't see the problem with your dual() expression, I'm afraid. It seems like it should work.

Not applicable
Author

J
Not applicable
Author

John,

I was having this problem because in the Chart properties (Number tab), I had formatted the numbers to "Fixed to" and 2 decimal places. I removed the formatting from the Number format settings and set it back to default. Instead, I added the Num function to my dual expression to limit it to two decimal places and now it is working perfectly!

Thanks a ton for all your help.

Roopali