EpmQueryRawFunction Function

<< Click to Display Table of Contents >>

 

EpmQueryRawFunction Function

Returns values as they were stored on the database, without applying aggregations.

EpmQueryRawFunction(
  @timeZoneOffset float,
  @startTime      datetime,
  @endTime        datetime,
  @valuesPerNode  int,
  @returnBound    bit,
  @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

valuesPerNode: Maximum number of records returned by this query. The value 0 (zero) in this parameter indicates that all query records must be returned

returnBound: Indicates whether this query must return the value stored immediately before and after the informed interval

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 OpcTag05
  FROM dbo.EpmQueryRawFunction(-2,_
    '01/15/2013 12:00:00', '01/31/2013 12:00:00',
    0, 0, 'OpcTag05')
  AS EpmQueryRawFunction_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?