3 Replies Latest reply on Jan 11, 2018 8:03 PM by John Messinger

    Error to double




      I created some attributes using the same expression for each one's analysis, but one specific attribute gives back the following error:

      Calc:Invalid cast: [Error] to double


      Any ideas?

      Thank you

        • Re: Error to double

          Hi Styliani,


          That message is an indication something is incorrect with the Analysis associated with that attribute. The analysis is outputting and error message, which is then trying to be passed to attribute of type Double causing it to display this message. I would recommend taking a look at the analysis in PI System Explorer, hitting Evaluate there and see if it gives you a more specific error there.


          I suspect that if this is the same analysis expression for a number of different attributes that likely one of the source tags to the analysis is in error - so I would also recommend checking the source tags to the analysis to confirm they're in good health.




          • Re: Error to double
            John Messinger

            Where I am having these sort of issues due to bad underlying source values, I tend to modify the logic of the calculation step to incorporate the BadVal() function into an IF..THEN..ELSE block:


            IF NOT BadVal('sourceAttribute') THEN

            {perform whatever operation}

            ELSE 0


            It may mean rethinking other steps, or if this is the only or final step, then you may wish to output no value with NoOutput(), or an alternative value indicating an unsuccessful calculation result.



            1 of 1 people found this helpful