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

Restrict Range using a function

Hello Folks,

  I have a line chart, and the default range for the chart is way to high.  The measure of the chart is "SUM(ord_totalmiles)" so I thought that using "SUM(ord_totalmiles) * 1.2" would bring it down to acceptable levels.  However, the selections that are being made don't seem to be influencing this sum.  How do I say in Qlik "Take the max sum (sum of miles) of the dimension (pay period)  in question based on the other selections in the chart (the driver the user has chosen), and then multiply that by 1.2".


Here is a picture of the chart showing the problem,  I've selected a Driver, yet the range is 300K+ when the max value is only around 1.6K.

BadRange.PNG

1 Solution

Accepted Solutions
dan_sullivan
Creator II
Creator II

Try this:

Max(AGGR(SUM(ord_totalmiles),payperiod))*1.2

View solution in original post

2 Replies
dan_sullivan
Creator II
Creator II

Try this:

Max(AGGR(SUM(ord_totalmiles),payperiod))*1.2

JustinDallas
Specialist III
Specialist III
Author

Thanks Dan!  This was my final solution:

Max({<InPayWindow={1}>}AGGR(SUM(ord_totalmiles),pyh_payperiod))

In layman's terms, I'm saying , Find the  SUM(ord_totalmiles) GROUP BY pyh_payperid. Take the max of that list/table provided that the InPayWindow = 1.

My chart now looks like this.

GoodRange.PNG