Calculation GetSummary
- Last UpdatedJun 15, 2023
- 2 minute read
- PI System
- PI Web API Reference
- Developer
Calculation GetSummary
Returns the result of evaluating the expression over the time range from the start time to the end time. The time range is first divided into a number of summary intervals. Then the calculation is performed for the specified summaries over each interval.
Request
GET calculation/summary
URL Parameters
-
webId The ID of the target object of the expression. A target object can be a Data Server, a database, an element, an event frame or an attribute. References to attributes or points are based on the target. If this parameter is not provided, the target object is set to null. See WebID for more information.
-
expression A string containing the expression to be evaluated. The syntax for the expression generally follows the Performance Equation syntax as described in the PI Server documentation, with the exception that expressions which target AF objects use attribute names in place of tag names in the equation. See Performance Equations for more information.
-
startTime An optional start time. The default is '*-1d' for element attributes and points. For event frame attributes, the default is the event frame's start time, or '*-1d' if that is not set. See Time Strings for more information.
-
endTime An optional end time. The default is '*' for element attributes and points. For event frame attributes, the default is the event frame's end time, or '*' if that is not set. Note that if endTime is earlier than startTime, the resulting values will be in time-descending order. See Time Strings for more information.
-
summaryType Specifies the kinds of summaries to produce over the range. The default is 'Total'. Multiple summary types may be specified by using multiple instances of summaryType. See Summary Type for more information.
-
calculationBasis Specifies the method of evaluating the data over the time range. The default is 'TimeWeighted'. See Calculation Basis for more information.
-
timeType Specifies how to calculate the timestamp for each interval. The default is 'Auto'. See Time Type for more information.
-
summaryDuration The duration of each summary interval. See Summary Duration for more information.
-
sampleType A flag which specifies one or more summaries to compute for each interval over the time range. The default is 'ExpressionRecordedValues'. See Sample Type for more information.
-
sampleInterval A time span specifies how often the filter expression is evaluated when computing the summary for an interval, if the sampleType is 'Interval'.
-
selectedFields List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned. See Selected Fields for more information.
Status Codes
200: The calculated values.
409: The targeted object does not support the calculation.
Sample Response Body
{
"Items": [
{
"Type": "Total",
"Value": {
"Timestamp": "2014-07-22T14:00:00Z",
"UnitsAbbreviation": "m",
"Good": true,
"Questionable": false,
"Substituted": false,
"Annotated": false,
"Value": 12.3
}
},
{
"Type": "Total",
"Value": {
"Timestamp": "2014-07-22T14:00:00Z",
"UnitsAbbreviation": "m",
"Good": true,
"Questionable": false,
"Substituted": false,
"Annotated": false,
"Value": 12.3
}
}
],
"Links": {}
}