2 Replies Latest reply on Aug 3, 2018 4:01 PM by JackChimSe

    Summing total attribute values by each day in a month

    JackChimSe

      Hello guys,

      I am new to PI environment and trying to get data from PI AF server. My expected result is a list of 30 values, each is total of an attribute's values in a day.

      Below is my code:

      AFAttribute attr = AFObject.FindObject(path) as AFAttribute;
      var sumary = attr.Data.Summaries(rangeAMonth, new AFTimeSpan(days:1), AFSummaryTypes.Total, AFCalculationBasis.TimeWeighted, AFTimestampCalculation.Auto);
      

       

      The total result was wrong.

      And I did tried to get average*count (using AFSummaryTypes.Average and AFSummaryTypes.Count). But count is seconds of a day(86400), not number of values in a day.

      Can anyone figure out the solution for my expected result?

      Thanks