Hi Jon,
Do you have PI ACE available? Or the option of implementing some PI SDK code?
I don't think you can do that conditional check inline of a Performance Equation. The options I see for you would be:
1. Create an additional Performance Equation that first filters out irrelevant data for the avergaes.
You would have "Raw Tag" then a "Filtered Tag" with a PE like:
Code:if ('equipmentTag' = "Off" then nooutput()) else (if badval('rawTag') then nooutput() else 'rawTag')
*Note, this is from memory and you would need to evaluate it first.
Finally, your average PE will reference the "Filtered Tag" not the "Raw Tag":
Code:TagAvg('filteredTag',(if Hour('*')<12 then ('t-12h') else ('t+12h')),'*')
2. Create the averaging in either PI SDK code or using PI ACE. There are calls to filtered summaries that you can use.
Principal Consultant
Real-Time Data Management @ Wipro Technologies