Thanks for reaching out to us on PI Square!
If I understand you correct, it sounds like you're running into a sensor issue where it will report an erroneously high (or low) value for the total amount of flow through a pipe you're trying to filter out. I'm thinking something like the following might be what you're looking for. In my example below you would need to write the result of the Analysis back to another tag:
Previewing the results, you can see only some of the values are being sent:
Rob - Thanks for the reply.
I had thought about a 2ndary tag that would basically "clean" the data for errored values. The problem with the example above, is in the totalizing aspect of the data. In the example above the individual "error" values may not be reported, but the total at the end would still be the same. Below is a fictious data set to describe the situation:
The increase expressed between 5:29 and 5:30 (36K) is not possible. The hourly total would be then improperly elevated 36K. I would rather then total either a) ignore that increase and treat it as a 0, or use the previous 5 min average increase to replace it. Neither of these methods recovers exactly what the true value for that 5:29-5:30 timeframe was (but it will be closer then the factor of 10+ it is presently.
Perhaps logic similar to:
if 'PLC' - PrevVal('PLC','*') >100 then NoOutput() else 'PLC'-PrevVal('PLC','*') + 'running total'
output this to your 'running total' attribute and set it to trigger only on the PLC total tag. Basically, this should ignore the large step, but work after a large value. You will also need to reset the running total to zero at the start of each hour! It might take some playing around to get this right.