Hi everybody this is my first time in this blog and Sistemas Team are developing for us an algorithm inwhich we have some doubts. they are calculating the amount of time under a conditions defined. they are using the time filtered formula and the conditions are been implemented as an expression, the problem that we have is focus on the expression, we need to make an expression that calcule the average of a number of tags Avg(Tag1, Tag2, ....) but we need calculate this average without negative or cero numbers. We could calutale this average with an ACE logic but at the moment we cannot create a new tags. Please, could somebody help us to calculate this expression Avg (Tag1, Tag2....) not taking into account negative and cero numbers.

Thanks in advance...

José Carlos

Hi José,

I am trying to get a better understanding of your use case:

In any case, f you want to just filter zeros and negative values in a Performance Equation (be it in PI DataLink, a Performance Equation calculated tag, PI Totalizer Subsystem tag, etc), this expression might be helpful:

Avg(if('sinusoid'>0) then 'sinusoid' else NoOutput(), if('cdt158'>0) then 'cdt158' else NoOutput())

This returns the average of tags SINUSOID and CDT158, but filters zeros and negative values.