AFCalculation.CalculateSummaries Method
- Last UpdatedNov 18, 2025
- 4 minute read
- PI System
- AF SDK 2024 R2
- Developer
This method evaluates the specified expression over the passed time range.
The passed time range is first divided into a number of summary intervals.
The method then computes the specified summaries over each interval.
Namespace: OSIsoft.AF.Data
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static IDictionary<AFSummaryTypes, AFValues> CalculateSummaries( Object target, string expression, AFTimeRange timeRange, AFTimeSpan summaryDuration, AFSummaryTypes summaryType, AFCalculationBasis calcBasis, AFSampleType sampleType, AFTimeSpan sampleInterval, AFTimestampCalculation timeType )
Public Shared Function CalculateSummaries ( target As Object, expression As String, timeRange As AFTimeRange, summaryDuration As AFTimeSpan, summaryType As AFSummaryTypes, calcBasis As AFCalculationBasis, sampleType As AFSampleType, sampleInterval As AFTimeSpan, timeType As AFTimestampCalculation ) As IDictionary(Of AFSummaryTypes, AFValues) Dim target As Object Dim expression As String Dim timeRange As AFTimeRange Dim summaryDuration As AFTimeSpan Dim summaryType As AFSummaryTypes Dim calcBasis As AFCalculationBasis Dim sampleType As AFSampleType Dim sampleInterval As AFTimeSpan Dim timeType As AFTimestampCalculation Dim returnValue As IDictionary(Of AFSummaryTypes, AFValues) returnValue = AFCalculation.CalculateSummaries(target, expression, timeRange, summaryDuration, summaryType, calcBasis, sampleType, sampleInterval, timeType)
public: static IDictionary<AFSummaryTypes, AFValues^>^ CalculateSummaries( Object^ target, String^ expression, AFTimeRange timeRange, AFTimeSpan summaryDuration, AFSummaryTypes summaryType, AFCalculationBasis calcBasis, AFSampleType sampleType, AFTimeSpan sampleInterval, AFTimestampCalculation timeType )
static member CalculateSummaries : target : Object * expression : string * timeRange : AFTimeRange * summaryDuration : AFTimeSpan * summaryType : AFSummaryTypes * calcBasis : AFCalculationBasis * sampleType : AFSampleType * sampleInterval : AFTimeSpan * timeType : AFTimestampCalculation -> IDictionary<AFSummaryTypes, AFValues>
Parameters
- target
- Type: SystemObject
The target can either be a PIServer, an AFDatabase, or any derived objects of AFBaseElement. References to attributes or points within the expression are based on the target. - expression
- Type: SystemString
A string containing the expression to be evaluated. The syntax for the expression generally follows the Performance Equation syntax as described in the PI Data Archive documentation, with the exception that expressions which target elements use attribute names in place of tag names in the equation. - timeRange
- Type: OSIsoft.AF.TimeAFTimeRange
The bounding time for the evaluation period. - summaryDuration
- Type: OSIsoft.AF.TimeAFTimeSpan
The length of the summary interval. A value will be returned for each interval within the specified time range. - summaryType
- Type: OSIsoft.AF.DataAFSummaryTypes
A flag which specifies one or more summaries to compute over the time range. - calcBasis
- Type: OSIsoft.AF.DataAFCalculationBasis
Specifies the method of evaluating the data over the time range. - sampleType
- Type: OSIsoft.AF.DataAFSampleType
Together with the sampleInterval, specifies how and how often the filter expression is evaluated. - sampleInterval
- Type: OSIsoft.AF.TimeAFTimeSpan
When the sampleType is Interval, it specifies how often the filter expression is evaluated when computing the summary for an interval. - timeType
- Type: OSIsoft.AF.DataAFTimestampCalculation
An enumeration value that specifies how the timestamp is calculated.
Return Value
Type: IDictionaryAFSummaryTypes, AFValuesReturns a dictionary of AFValues, each collection of values corresponds to one summary type.
Remarks
Calculations are limited to Attributes or PI Points which originate from a single PI Data Archive.
Attributes which resolve to a static value (no data reference configured), are also acceptable.
| Due to the limitations of the PI Data Archive, expressions with discrete PI Points will not respect the step attribute at all times. |