Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ BI Gateway

AddMeasureDateRangeEvent() method

  • Last UpdatedAug 23, 2024
  • 3 minute read

The AddMeasureDateRangeEvent() method adds events for a Measure object having particular given calculation or a set of calculations and a given dimension or a set of dimensions for a specific date time range. The date time range consists of a start date time and an end date time.

For dimension, any dimension field could contribute as a processing criteria to the measure execution.

URL: https://<BI Gateway URL>/eventapi/odata/Event/AddMeasureDateRangeEvent

For example: https://eu.v2.bigateway.connect.aveva.com/eventapi/odata/Event/AddMeasureDateRangeEvent

Important Note: You are required to add the TenantID as a header. For example, 'x-wwTenantID'.

For more information on how to identify the tenant ID, see Identify the tenant ID.

Refresh measure objects for a date range

Request

Parameter Type

Parameter Name

Description

Data Type

Input Request

ObjectName

The Data Transfer Object which holds three attributes: ObjectName, Calculation list, Dimensions list, StartDate, and EndDate.

DTO (valid JSON format)

Return value:

A GUID (for example: 00000000-0000-0000-0000-000000000000) is returned corresponding to the event created in the database. If the AddMeasureDateRangeEvent() method fails, an error is logged in the Application Insight and the API returns a value of zero.

Postman example

The following Postman code snippet shows the example for the query.

Note: Replace the values for ObjectName, Measure, StartDate, and EndDate according to your requirement.

{"ObjectName":"Measure_001","StartDate":"2021-01-02 08:00:00Z","EndDate":"2021-01-03 23:59:59Z"}

If the query is successful, the relevant GUID is displayed as a response.

For more information about Postman installation and configuration, see Configuring Postman Settings.

Refresh measure objects for specific calculations and dimensions for a date range

Request

Parameter Type

Parameter Name

Description

Data Type

Input Request

jsonstring

The Data Transfer Object which holds three attributes: Object name, StartDate, EndDate.

DTO (valid JSON format)

Important: Make sure that the Start DateTime and End DateTime parameter is in UTC date and time format.

Return value:

A GUID is returned corresponding to the event created in the database. If the AddMeasureDateRangeEvent() method fails, an error is logged in the Application Insight and a value of zero is returned.

Postman examples

The following Postman code snippets show the examples for the query.

Note: Replace the values for ObjectName, Calculation list, Dimensions list, StartDate, and EndDate according to your requirement.

Process a single calculation for a single dimension field

{

"ObjectName": "Measure_001",

"Calculations": [

"Count"

],

"Dimensions": [

{

"Dimension_001": [

{

"ShiftName": "Morning"

}

]

}

],

"StartDate": "2021-03-13 06:30:00.00Z",

"EndDate": "2021-03-13 07:30:00.00Z"

}

If the query is successful, the relevant GUID is displayed as a response.

Process a single calculation for multiple fields of a single dimension

{

"ObjectName": "Measure_001",

"Calculations": [

"Count"

],

"Dimensions": [

{

"Dimension_001": [

{

"ShiftName": "Morning"

},

{

"ShiftName": "Night"

}

]

}

],

"StartDate": "2021-03-13 06:00:00.00Z",

"EndDate": "2021-03-14 06:00:00.00Z"

}

If the query is successful, the relevant GUID is displayed as a response.

Process a set of calculations for a set of fields of dimensions

{

"ObjectName": "Measure_001",

"Calculations": [

"Count",

"Sum"

],

"Dimensions": [

{

"Dimension_001": [

{

"ShiftId": "2249"

}

],

"Dimension_002": [

{

"WorkOrderId": "PO_20210313_7701"

}

]

}

],

"StartDate": "2021-03-13 06:30:00.00Z",

"EndDate": "2021-03-13 07:30:00.00Z"

}

If the query is successful, the relevant GUID is displayed as a response.

Process an expression calculation for a set of dimension fields

Mention all the primary calculations used in the expression calculation.

{

"ObjectName": "Measure",

"Calculations": [

"TotalEnergy",

"QuantityProduced",

"QuantityRejected",

"AverageSpeed"

],

"Dimensions": [

{

"Asset": [

{

"AssetName": "Filler01"

},

{

"AssetName": "Filler02"

}

],

"Shift": [

{

"ShiftId": "Night"

}

]

}

],

"StartDate": "2021-03-09 22:00:00.00Z",

"EndDate": "2021-03-15 06:00:00.00Z"

}

If the query is successful, the relevant GUID is displayed as a response.

For more information about Postman installation and configuration, see Configuring Postman Settings.

TitleResults for “How to create a CRG?”Also Available in