Is there a way to get the average value of one tag, based on the value of another tag?
In other words, I need the average 'speed' over an hour, when ANOTHER tag equals 0.
Thanks for the input.
There are many ways to do that. Which client tool would you be using? Are you talking about PI Points only or are you an AF user?
If you're using Asset Analytics, you could do something like 'If Status has been Equal to 1 over the past hour (1h = 3600s) Then find the Average of the Speed over the past hour Else do nothing.' The analysis would need to be set to run periodically.
Note: NoOutput() only works if you're outputting to a tag (versus an attribute); otherwise, you'll receive an error that says 'Functions such as NoOutput are not supported unless all mapped outputs are configured to save output history.'
Hope this helps!
I believe that your formula would only return the average speed if the entire hour had a status of 1.
My status is constantly changing from 0 to 1 and back...and I only want the average speed for those times when the status was 1.
Thanks for your input.
As Stephen Kwan pointed out, there are different ways depending on the client tool and your goal...
To set up such filtered calculation in AF please check the https://techsupport.osisoft.com/Troubleshooting/KB/KB01120 .
But if you need this only as a report, it can be easy as pi(e) with PI-Datalink using an advanced filtered calculation.
Something similar to: =PIAdvCalcFilVal("ABC","*-1h","*","'XYZ'=""Status1""","average","time-weighted","interpolated","1m",90,1,4,"")
You can find help in OSIsoft's live library also: PI DataLink
Retrieving data ...