3 Replies Latest reply on Apr 19, 2018 6:22 AM by Eugene Lee

    Entry count different filter expression?

    msj_

      Hello,

       

      I have been following PI Datalink, looking to count how many times an alarm activated  and Count tag Entries over a timeframe and to count frequency of entries.

      I only need the count, therefore I'm using the calculated data method, however the two answers used slightly different filter expressions:

       

      1. The following expressions give me different numbers and I do not understand what the role of '*' is in the expression:

           - TagVal('Tag', '*') > 30          returns 831

           - TagVal('Tag') > 30               returns 564

           - 'Tag' > 30                             returns 564

       

      2. If I have an array of 100 tags, can I use 1 set of calculated data like this? Unsure of whether the expressions would correspond to each data item.

           Alternatively I would need to set up 1 calculated data array for each tag?

          

       

      Thank you,

       

      Shiji

        • Re: Entry count different filter expression?
          Eugene Lee

          Hi Shiji,

           

          1. '*' in the expression represents the current time that you are querying. Hence, if you use that in the filter expression, you will just be comparing only the current value (1 value) to the constant. Without the '*', you will be comparing each archived value (multiple values) to the constant. In your use case, you should use it without '*'. 564 is the correct answer.

           

          2. If you are using different filter expressions, then you need to set up 1 calculated data array for each tag. If you are not using filter expressions, then you can use 1 set of calculated data which will become an array formula.

          1 of 1 people found this helpful