AnsweredAssumed Answered

PI AF - If then else statement

Question asked by TuiBray on Jun 7, 2018
Latest reply on Jun 25, 2020 by DanBrancaccio

Hi.  I'm new at using PI AF so may be completely on the wrong track (I have done a course but many years ago and have not used it since). 

 

I'm trying to determine the value of a newly created Tag (TagX) based on the value of several other tags.  In Attributes I have loaded the criteria tag values.  Then in Analyses I have created an IF then else statement as below to determine the value of TagX.  My problem is that the If Then Else statement is very large and difficult to edit.  Is there a better way of doing this?

 

If 'TagA'>25 and 'TagB' < 35 and 'TagC' > 5 and 'TagD'<35 and 'TagE>25 then 'TagF+ 'TagG'- 'TagH'

else (if 'TagA'>25 and 'TagB' < 35 and 'TagC' > 5 and 'TagD'<35 and 'TagE<25  then 'TagI

else (if 'TagA'>25 and 'TagB'>35 and 'TagC'>5 and 'TagD'>35 and DigText('TagJ)="Active" then 'TagK'

else (if 'TagA'>25 and 'TagB'<35 and 'TagC'>5 and 'TagD'>35 and 'TagE>25 and DigText('TagJ)="Active" then 'TagG'-'TagH'

else (if 'TagA'>25 and 'TagB'<25 and 'TagC'<5 and 'TagE>25 and DigText('TagJ)="Active" then 'TagF+ 'TagG''TagH'

else (if 'TagA'>25 and 'TagB'>35 and 'TagC'>5 and 'TagD'<35 and 'TagE>25 and DigText('TagJ)="Active" then 'TagF

else (if 'TagA'<25 and DigText('TagJ)="Active" then 0 else NoOutput()))))))

Outcomes