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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Axis Maximum

I am trying to calculate a dynamic maximum for an axis on a stacked bar chart

What I want is to calculate is the total of Sales Value for cases that are ‘Open’, ‘Won’ and ‘Lost’ by SalesPerson for the current selection(s) and then use the Salesperson with the highest total  to set the axis max.

The dimension is SalesPerson

The value required is used for an expression:

sum(if(Status = 'Open' OR Status = 'Won' OR Status = 'Lost', [Sales Value]))

I need to use the above calculation  (or set analysis equivalent) to find the Sales person with the highest total. From my investigations I don’t think I can use max() , FirstSortedValue() and I am not sure if I can use aggr() .

Can anyone help?

Regards

Jason

1 Solution

Accepted Solutions
Not applicable
Author

Hi Jason,

Barring syntax error...

Following should give you the answer

max(aggr( sum(if(Status = 'Open' OR Status = 'Won' OR Status = 'Lost', [Sales Value])),SalesPerson))

If you have having chart (using the above under Axes will do the trick)

Regards

View solution in original post

4 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use the expression as below in the axis max.

     =Sum(TOTAL {<Status={'Open','Won','Lost'}>} [Sales Value])

     U can achieve this using set analysis.

Hope it helps

Celambarasan

v_iyyappan
Specialist
Specialist

Hi,

     In Chart propertities -> Axes ->Scale ->StaticMax ->Paste this expression

= Sum(TOTAL {<Status={'Open','Won','Lost'}>} [Sales Value])

Regards,

Iyyappan

Not applicable
Author

Hi Jason,

Barring syntax error...

Following should give you the answer

max(aggr( sum(if(Status = 'Open' OR Status = 'Won' OR Status = 'Lost', [Sales Value])),SalesPerson))

If you have having chart (using the above under Axes will do the trick)

Regards

Not applicable
Author

Kulbir,

I thought it might be resolved using aggr(), but I couldn't work it out!

Thanks very much for your help.

Jason