AnsweredAssumed Answered

PI Calc - Dataset Average of an IF Statement

Question asked by SK1985 on Apr 3, 2020
Latest reply on Jul 29, 2020 by LeventN

I have built an IF, THEN, ELSE statement into the expression of a Calculated Tag with the aim to average the result when the IF statement is True.  This is possible and works correctly when the current result of the IF statement is TRUE.  However when the current result of the IF statement is FALSE all options for Dataset Columns are removed apart from Value and Count.

In the example shown I am aiming 30d average (3*((0.8*'1IDFBFDUSTINST')+4)) but only when the feeder PV >0.1.

Currently the feeder is less then >0.1.  The first result is therefore non-numerical and an average cannot be performed.

In the second example I have changed the IF to <0.1 which gives a TRUE result, a numerical solution and the average is performed.


Is there a solution/function that resolves this?  I have seen that if the ELSE is numerical (ELSE "0") it will allow the average however the "0" then skews the average.