Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 abhaysingh
		
			abhaysingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi All,
i have one scenario in which Sensor are sending temperature every minutes.
and there is possibility for them that sensor become faulty and will not sending any data .
so let say i have 50 sensor i want to pick there last temperature record so i am using
firstsortedvalue(SensorStatus,-Timestamp)
so i am using it in straight table and its working perfenctly..
now i want the count of Faulty assets should be displayed in Text Box..
let say sensor is out of range than i need to count of sensor which are out of range in text box.
How i can do that?
pls suggest..
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this:
Sum(Aggr(If(FirstSortedValue(SensorStatus,-Timestamp) = 'Faulty', 1, 0), Sensor))
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		May be this:
Sum(Aggr(If(FirstSortedValue(SensorStatus,-Timestamp) = 'Faulty', 1, 0), Sensor))
 
					
				
		
 jonathandienst
		
			jonathandienst
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		>>let say sensor is out of range than i need to count of sensor which are out of range in text box.
By out of range, so you mean that the last update was older than a threshold value? Then somethng like:
=Count(Aggr(If(Max(Timestamp) <= (Now() - (vThreshold / 1400)), SensorID), SensorID))
(where vThreshold is a timeout period in minutes, SensorID is a unique sensor ID)
This expression will count the sensors whose last update was more than vThreshold minutes ago.
 
					
				
		
 abhaysingh
		
			abhaysingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HI Sunny,
in above scenario there is one more case
Sum(Aggr(If(FirstSortedValue(SensorStatus,-Timestamp) = 'Faulty', 1, 0), Sensor))
i want the count for Faulty and Faulty1, Do i need to add it or i can do in one exp?
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try this:
Sum(Aggr(If(Match(FirstSortedValue(SensorStatus,-Timestamp), 'Faulty', 'Faulty1'), 1, 0), Sensor))
