AnsweredAssumed Answered

error evaluating tag or expression

Question asked by JoelNHS on Oct 2, 2019
Latest reply on Oct 6, 2019 by JoelNHS

Hi there,

 

I'm attempting to create a new data set in PI ProcessBook that will simply wind direction factors for a display I'm building. I have created the expression and believe it to be correct. The aim of the expression is to take the 1min average of the wind direction (degrees) and convert that to a category (1-8). I can confirm that the tag reference is correct. I am at a loss as to where the error in the expression is... can anyone help? Many thanks.

 

The expression:

 

IF TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') >= 337.5 AND TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') <= 22.5 THEN 1 ELSE IF TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') > 22.50 AND TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') <=67.50 THEN 2 ELSE IF TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') >67.50 AND TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*')<=112.50 THEN 3 ELSE IF TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') >112.50 AND TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') <=157.5 THEN 4 ELSE IF TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') >157.5 AND TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*')<=202.5 THEN 5 ELSE IF TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') >202.5 AND TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*')<=247.5 THEN 6 ELSE IF TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') >247.5 AND TAGAVG(‘ho.gw.BRWS_DIR_MEASURE’,'*-1M','*') <=292.5 THEN 7 ELSE 8

Outcomes