Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Axis Scaling Issue

Hi,

I have a simple bar chart using counts of data where the values could range from 1 to potentially hundreds. This can be filtered down to low numbers quite often, so I'm using the automatic Y-Axis scaling at the moment.

However, when you have values in the chart that are all below 5 the axis automatically starts creating decimal values (0.5, 1.0, 1.5 and so on) which can never happen as it's an integer.

How can I stop this from happening? I don't want to create a static step as this will reduce the appeal of the chart when the bigger numbers are showing. Is there some sort of formula I could use in the static step to get this going?

Thanks in advance

Nick

1 Solution

Accepted Solutions
Or
MVP
MVP

I haven't had to do this in a while, but iirc, I had some luck checking the "Static step" box, and using a formula in it:

if(max(aggr(count(myValueField),Dimension1,Dimension2))<=5,1)

View solution in original post

5 Replies
Not applicable
Author

Might just be coincidence that it worked with my data but i have used

aggr(count(data),date)

as the expression for the static step and it defaults the step to the lowest unit for the selection automatically, if you always have integers then your lowest unit will be an integer. You can swap date for whatvere your dimension may be

Not applicable
Author

Thanks for this, it nearly works but not quite!

I should have said the chart has two dimensions, the second dimension being month-on-month comparison. If there is only one month to display, this new step formula works perfectly and loses the decimal scale values (the scale just goes from 0 to the value, which is fine). However if you have multiple months for an entry all below 5 it still insists on having 0.0, 0.5, 1.0, 1.5, 2.0 and so on up to 4.

I've tried adding "month" to the aggregation statement but it's not really worked either.

Any further ideas?

Thanks

Nick

quwok
Creator III
Creator III

To set the scale of an expression, go to Chart Properties > Axes, in the Expression Axes box select the expression you like to change the scale of, in the Scale section on the right tick Static Step and enter 1 into the text box.

Or
MVP
MVP

I haven't had to do this in a while, but iirc, I had some luck checking the "Static step" box, and using a formula in it:

if(max(aggr(count(myValueField),Dimension1,Dimension2))<=5,1)

Not applicable
Author

Brilliant, that worked perfectly!

Thanks very much.

Nick