AnsweredAssumed Answered

TagName() error handling in AF Analysis

Question asked by Abu.Salam on Aug 8, 2019
Latest reply on Aug 8, 2019 by skwan

Hello mates!


Trying to find a way to handle the Calc Failed error message when TagName() cannot find a tag for an attribute.


I have 2 AF attributes, FIT_YEST_CA and FIT_YEST.  We also have mixer of tag names with suffix either FIT_YEST_CA or FIT_YEST.  


With TagName() function I can find out which tag is exists - however, when I use any IF condition to determine what action I want to take then I get Calc Failed error since one of them does not exist.


I was trying the following code:


if Len(TagName('FIT_YEST')) > 0 then "|FIT_YEST"
else if Len(TagName('FIT_YEST_CA')) > 0 then "|FIT_YEST_CA"
else "|FIT_YEST"


I was wondering, if anyone knows a best way to handle this error like in MS Excel we have IFERROR()


Any help will be highly appreciated.