EpmQueryAggregateFunction Function

<< Click to Display Table of Contents >>

 

EpmQueryAggregateFunction Function

Returns data in a format defined by the aggregation function indicated by the aggregateFunction parameter.

EpmQueryAggregateFunction(
  @timeZoneOffset    float,
  @startTime         datetime,
  @endtime           datetime,
  @sampleInterval    bigint,
  @aggregateFunction nvarchar(30),
  @node              nvarchar(max))

 

Where:

timeZoneOffset: Timezone to consider. This value is a floating-point number ranging from -12 to 14

startTime: Query's starting date. The date format depends on the database configuration

endtime: Query's ending date

sampleInterval: Time interval used to calculate the aggregation, informed in milliseconds

aggregateFunction: Name of the aggregation function to use. Valid values for this parameter are Trend, Interpolative, Average, Total, Count, Minimum, Maximum, MinimumActualTime, MaximumActualTime, Range, Delta, TimeAverage, TotalizeAverage, AnnotationCount, DurationINState0, DurationINState1, NumberOfTransitions, Start, End, DurationGood, DurationBad, PercentGood, PercentBad, and WorstQuality. A more detailed description of these functions can be checked on topic Creating a Dataset on Manual do Usuário do Elipse Plant Manager

node: Name of the Data Object to query. Users can also inform a reference and a full path on the Contextual Model, if it was contextualized

 

Usage example:

SELECT Timestamp AS Time,
  Value AS AvgOpcTag05
  FROM dbo.EpmQueryAggregateFunction(-2,_
    '01/15/2013 12:00:00', '01/31/2013 12:00:00',
    3600000, 'Average', 'OpcTag05')
  AS EpmQueryAggregateFunction_1

 

In this case, the query returns the average values of Basic Variable OpcTag05 from the second half of January calculated with a one-hour window. Notice that the timeZoneOffset parameter was defined as -2 (minus two) and not -3 (minus three, GMT relative to Brasília) because in January there was a daylight saving time where data was stored.

Was this page useful?