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

Function that returns a chart scale

Hi,

is there a function or any other way to return the scale of a chart?

My goal is to use it in another chart to set both of them at the same scale.

Thanks in advance.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

You're on the right track, but what you posted has an extra paren before the second sum.

max(aggr(sum(energy)/sum(surface),zone))

View solution in original post

11 Replies
its_anandrjs
Champion III
Champion III

Hi,

Yes but when you use the scalling option in axes tab and by the help of the variables for this you need to put variables

for

MinScale

MaxScale

ScaleSep

and use it different charts the same objects

HTH

Regards,

Anand

suniljain
Master
Master

are you talking about hieight and width of chart ?.

Not applicable
Author

How can I set the variable?

I explain, in my case, the maxscale for Chart 1 should be equal to the biggest bar (over more than 10) in chart 2. But the biggest bar value is not static and might change depending on previous selections.

suniljain
Master
Master

pls read apiguide.qvw . you have to write macro for this types of requirement.

Not applicable
Author

Only height of the bar. I want the charts to have the same dynamic scale, which would be equal to the biggest bar present on both charts.

its_anandrjs
Champion III
Champion III

Hi,

Ok understand you need to fix only the height of the bar as Sunil say you need to refer to the Apiguide and to achieve this write a macro code.

Regards

Anand

Not applicable
Author

Ok I will do it. I will post an answer if I manage to fix this.

Not applicable
Author

I can't figure out how to do the following:

I have 3 different fields: energy, surface, and zone.

I need to calculate for each zone: sum(energy)/(sum(surface) and to return the max.

I tried something like max(aggr(sum(energy)/(sum(surface), zone)), but aggr won't accept the division.

Once I can do this, it will be very easy to post a script. I will just have to stock it in a variable and put it as static max for the scale. Anybody to help me?

johnw
Champion III
Champion III

You're on the right track, but what you posted has an extra paren before the second sum.

max(aggr(sum(energy)/sum(surface),zone))