AnsweredAssumed Answered

PI Analyses IF-THEN-ELSE Nothing

Question asked by DavidMFairchild on Oct 30, 2017
Latest reply on Oct 30, 2017 by jru

I'm trying to filter a lake level tag that occasionally returns out-of-range values.  I cannot use a fixed filter since the bad values are in the range of the possible lake levels just not reasonable under the circumstances.  I am trying to use a PI-Analysis expression like this:

If (Abs(TagAvg('LakeElevation', '*-5m', '*') - TagVal('CurrLakeLevel', '*'))/TagAvg('LakeElevation', '*-5m', '*') < 'MaxRateOfChange') Then ( TagVal('CurrLakeLevel', '*') ) Else Nothing

 

But this doesn't work.  I have tried null instead of nothing and leaving the 'Else' clause off, but neither of those work either.

 

My preference would be to have no value added to the corrected lake level tag if the value from the level gage is bad.

 

Does anyone know how to do this?

Also is there a better Help system for PI-analytics than the help file that comes with PI-AF?

 

Thanks,

Dave

Outcomes