Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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?

1 Reply
JonnyPoole
Employee
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 ) )