3 Replies Latest reply on Jul 19, 2016 7:26 AM by Maciej

    Finding max value over specific months of any year


      I am trying to find the maximum value from a set of data, but only for the months of June through September, and also for any year.  I tried using a simple expression like TagMax('Power Receieved','1-jun','1-oct'), but that only finds the maximum value within those months for the current year.  So is there a way to reference specific months like this but for any year?

        • Re: Finding max value over specific months of any year

          Hi, Nishantha


          Maybe you can try using Max Function.

          Since you can specify the year of the date for the time range (ex. TagMax('Power Received','1-jun-2015','1-oct-2015')), you can get each max value for each year and find the maximum value within the max values of each year.


          Here is a simple Example : (If you want the Max value of June through September from 2013 to 2015)

          Max(TagMax('Power Received','1-jun-2015','1-oct-2015'),TagMax('Power Received','1-jun-2014','1-oct-2014'),TagMax('Power Received','1-jun-2013','1-oct-2013'))

          • Re: Finding max value over specific months of any year

            I was thinking of an AF analysis that determines the month
            and the date range for the month, then outputs to a PI Point DR for that month.


            You could then use the settings on the monthly PI Point to control
            the retrieval method, so By Time : select Time Range, provide a Relative Time
            range, and finally By Time Range needs to be set to Maximum.


            The link below would help in determining the monthly time range. Calcs will run once a day, but you can manage when the result is produced, like on the first day of the month for the previous month, using an if.

            Defining periods in PI AF Analyses

            • Re: Finding max value over specific months of any year

              Hi Nishantha,

              you can create a analysis in Pi Analitics and backfill it to pi tag:


              and remember about trigger:


              Then you can just forform standard PI function like show me maximum value of TagName during June over last few years:




              This will do the trick.