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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Highest value for an expression

Find max value of an expression.

I have an expression for machines 1-7 which says:

total transfer time = sum( If(Program <> 'DETECT STOP', DowntimeDuration))

What expression should I use, to find the machine number which gives highest value of total transfer time?

Labels (1)
1 Reply
JonnyPoole
Former Employee
Former Employee

You need to take the maximum of the subtotals by machine number.  It would look like this

max(  aggr(  sum( If(Program <> 'DETECT STOP', DowntimeDuration)) , MachineNumber ) )

Where MachineNumber is the field that stores the machine numbers.

Depending on context, you may need a TOTAL in the max()

max( TOTAL  aggr(  sum( If(Program <> 'DETECT STOP', DowntimeDuration)) , MachineNumber ) )