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

How to determine scale based on max value

Hi all,


I would like to determine the scale of my bar charts based on the max value, shown in black "circle" below.


Could you help me?

Verdeling man-vrouw.PNG

7 Replies
devarasu07
Master II
Master II

Hi,

yes it can be done.

go to your bar chart object properties --> axes tab --> scale (here u can define min, max value)

Capture.JPG

Anonymous
Not applicable
Author

Hi Devarasu,

I filled in the statistic max as follows :

     =if(

     count(distinct

     if(Gesl = '2',

     InkomstenverhoudingInitieel_Id)) >

     count(distinct

     if(Gesl = '1',

     InkomstenverhoudingInitieel_Id)),

     count(distinct

     if(Gesl = '2',

     InkomstenverhoudingInitieel_Id)),

     count(distinct

     if(Gesl = '1',

     InkomstenverhoudingInitieel_Id)))

my expressions are:

=count(distinct {<Gesl = {'1'}>} InkomstenverhoudingInitieel_Id)

=count(distinct {<Gesl = {'2'}>} InkomstenverhoudingInitieel_Id)


Target of my question is to make the small bars a bit bigger. Now the max value is <1000 and I have a max scale of 2000. That's waste of space in my charts.


Hope you can help me.


Grtz,

Pascal



devarasu07
Master II
Master II

Hi,

would be able to share your mock app. mean while have you tried to enable "Log Scale"  option on your chart axes tab? . Thanks

Regards,

Deva

jonathandienst
Partner - Champion III
Partner - Champion III

The max value can be calculated for scale purposes using the expression:

=Aggr(<chart expression here>, <dimension 1>) (for one chart dimension)

=Aggr(<chart expression here>, <dim1, ..., dimn>) (for more chart dimensions)


Insert the chart expression and chart dimension(s) in the placeholders above.


You can insert the expression into the Static Max box above after testing in a text box.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks Jonathan.

Last step is to round off my maxrange at 1000, but where do I have to put the round function? (or other function)

Verdeling man-vrouw II.PNG

Thank you in advance.

devarasu07
Master II
Master II

Hi,

syntax:

Round(Expression, 0)


example,

=Round(

if(

     count(distinct

     if(Gesl = '2',

     InkomstenverhoudingInitieel_Id)) >

     count(distinct

     if(Gesl = '1',

     InkomstenverhoudingInitieel_Id)),

     count(distinct

     if(Gesl = '2',

     InkomstenverhoudingInitieel_Id)),

     count(distinct

     if(Gesl = '1',

     InkomstenverhoudingInitieel_Id))) ,0)

jonathandienst
Partner - Champion III
Partner - Champion III

You probably want to round up the max (rounding down will clip the chart), so use Ceil() rather than round. It should be at the top, so use

=Ceil(.... your max expression ...., 1000)

For the static min, use Floor() to always round down, in the same way (or use 0 if that is what is required)

=Floor(.... your min expression ...., 1000)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein