Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 anseglko
		
			anseglko
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I want to show the equipment name with the longest interval in a KPI.
My data looks like this:
| ID | Equipment | Start | End | 
| 1 | 3 | 11:45:21 | 11:55:56 | 
| 2 | 2 | 11:49:11 | 11:53:23 | 
| 3 | 5 | 12:01:23 | 12:04:43 | 
and so on.
I have counted the duration in minutes for each entry. I simply used =interval(end-start,'m'). Then I take the maximum of those with max().
Now in the KPI widget I want to show the name of the elevator with the longest interval time. How would I do that?
 
					
				
		
 sergio0592
		
			sergio0592
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 
					
				
		
 sergio0592
		
			sergio0592
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Try with
=FirstSortedValue(Equipment,-Interval(End-Start)) anseglko
		
			anseglko
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you Sergio! This worked. It was more simple than I thought.
What about if I want the Equipment with the highest average interval (per equipment)?
EDIT: Managed to solve myself with
=FirstSortedValue(equipment,-aggr(avg(Interval(end-start)),equipment))