2 Replies Latest reply on Jun 10, 2011 4:14 PM by spilon

    PI sdk cannot get minimum value for a non-numeric field...

    IOMHouston

      When executing min/max (summary calculation) on a string tag, an error 

       

      Cannot do summary calculation on non-numeric data is generated.

       

       

       

      I understand the PI OldDB is based on the SDK. Why is it that I can get the maximum

       

      of a string using oIeDB, but I get an error when executing this query using the sdk.

       

       

       

      Does the oleDB control reads all the values and internally calculate the maximum (or minimum, total etc)

       

       

        • Re: PI sdk cannot get minimum value for a non-numeric field...
          Ahmad Fattahi

          The only comparison operator working with strings (and blobs) in the PI server is the “==” or “!=” (the EQUALS and NOT EQUALS) comparison operators.  And those will do simple byte-by-byte comparison.

           

          If your tag contain "numbers" then you may want to convert them into numeric tags before making any comparisons on the PI Server. Otherwise, you could use .NET capabilities in working with strings if you are developing a PI SDK application.

           

          PI OLEDB has its own internal logic to deal with such string values to make comparisons and calculating min, max, etc.

            • Re: PI sdk cannot get minimum value for a non-numeric field...

              @David: you are right that the classic PI OLEDB Provider is based on the PI SDK. However, the provider itself is handling some of the data manipulations based on the data returned by PI SDK, and as such some operations that aren't possible in PI SDK might be allowed in the relational database, ADO-related world.

               

              I would really like to better understand what your queries, source values and expected results are... with that in hand, we'll be able to answer your specific question and point you in the right direction. I must admit I am a little intrigued by the concept of min/max summaries on string data too...;)