Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Dynamic Y-axis

I would like to set a dynamic Y-axis with the Max function. I know it works but now I can not use a field in this function (error message is " Incorrect fieldname"). Is this because it is a calculated field?

1 Solution

Accepted Solutions
Specialist
Specialist

Hi Patric,

Yes, try aggr;

Max(aggr(sum(If([Produktbreedte]<1330,([lengte rol]-[netto lengte])*0.62,([lengte rol]-[netto lengte])*1.24)), dimension ))


I've tried to bold the bits to insert, dimension would be the dimension your chart uses, comma separated list if more than one.


Let me know how you get on.


Regards,


Chris.

View solution in original post

4 Replies
Specialist
Specialist

Patric,

There are definitely limitations as to where you can use the names you have given your expressions, there was a thread a couple of weeks ago on something similar, so I think your conclusion is correct.

If you copy in the original expression will that work? You may need to wrap an aggr round it (referencing the relevant dimensions) to get the right value.

Regards,

Chris.

Contributor II
Contributor II

Chris,

Thanks for your reply.

I have defined the following: Afkeur MD = sum(If([Produktbreedte]<1330,([lengte rol]-[netto lengte])*0.62,([lengte rol]-[netto lengte])*1.24)) (sorry for the dutch words)

This results in a sum of the square meters rejected material.

The max Y-axis I want defined as the max of these square meters.

I have this: Max(sum(If([Produktbreedte]<1330,([lengte rol]-[netto lengte])*0.62,([lengte rol]-[netto lengte])*1.24)))

but that doesn't work (error in expression)

If I need aggr how do I do that? Or is something else wrong?

Regards, Patric

Specialist
Specialist

Hi Patric,

Yes, try aggr;

Max(aggr(sum(If([Produktbreedte]<1330,([lengte rol]-[netto lengte])*0.62,([lengte rol]-[netto lengte])*1.24)), dimension ))


I've tried to bold the bits to insert, dimension would be the dimension your chart uses, comma separated list if more than one.


Let me know how you get on.


Regards,


Chris.

View solution in original post

Contributor II
Contributor II

Works great, thanks.

I 'forgot' the dimension in the aggr function,

Regards, Patric