4 Replies Latest reply on Jul 20, 2009 2:41 PM by andreas

    Calculating averages




      I am trying to calculate average, minimum and maximum values of a particular tags for a given start and end time in excel.


      I am able to do it through PICompDat function which can list all the values for a specific period of time. But that is very ugly process.


      I have to eliminate "#N/A" and "No more values:" messages in the column in every single cell for excel to be able to calculate the averages or the maximums which takes time.


      Provided I am not missing any tag attribute given in the datalink,


      Is there any faster way to get those values?


      Please reply



        • Re: Calculating averages

          There is a DataLink function called "Calculated Data" which does exactly what you're looking for.  All of the calculations are performed on the PI server, so the agregates are returned to you very quickly.  Also, the PI server properly considers the time-weighted nature of the compressed data (by default, you can over-ride this behavior) and so the answers you get are the most accurate possible.


          It is frequently the case that there are multiple ways to acomplish the same thing when using DataLink and Excel.  Just as often there are significant performance implications to which method you select.  I would strongly recomend that you take the time to go through all of the functions that DataLink offers at least once before you start designing sheets that use it.  You need to know what the various options are before you can pick the right way.


          To help you with this, the materials for our PI Clients training class are available on our training website.  We also provide Computer Based training for these products.  Either is a good option if you can not attend a class in person.  Also the DataLink manual describes each function in detail.