Measures
- Last UpdatedFeb 12, 2024
- 6 minute read
A measure is a group of calculations that shares the same context. A measure consists of calculations for each source system, time period, and for each unique combination of dimension value.
Measures are typically numerical values computed from source systems and put into context with dimensions. You can configure measures by defining which calculations need to be computed, along with the context (dimensions) to which the calculations are related. Upon deployment, a measure is represented by a table in the datastore, which contains the calculated values along with references to the related dimensions. Each record in the measure table represents a time-slice (period) for which the calculated values are computed.
Typically measure tables are updated with time, adding records for every time-slice defined by time-slicing dimensions and the measure period. As such, measure tables are updated incrementally, from the time defined by the data collection start time.
Because measure records are described by a time-slice, a measure object must at least have one time context defined either by a measure period, and/or time-slicing dimensions.
You can configure a measure period, which allows the computation of the measure calculations at the specified period. For example, a measure object configured with a measure period of one hour stores calculations in the measure table for every hour since the data collection start.
You can also add one or more time-slicing dimensions to the context of a measure. These time-slicing can be used instead of a measure period. At run time, time periods defined by all time-slicing dimensions and by the measure period are all combined together to create smaller, contiguous time-slices by which measure calculations are computed.
For more information about specifying a measure period, see "Configuring a Measure Period".
You have to provide a refresh rate for the measure. The refresh rate recomputes calculations for the current time-slice and also verifies whether a new time-slice must be defined. The following are three scenarios when considering the refresh rate and the measure period:
-
The refresh rate is smaller than the measure period or the time-slice.
The measure is updated until a new measure period or time-slice is identified. Thereafter, a new measure value is calculated.
-
The refresh rate is bigger than the measure period or the time-slice.
The refresh rate verifies whether a new measure period or a time-slice is identified since the last refresh period. New measure values are calculated for the identified measure period and time-slices.
-
The refresh rate is equal to the measure period or the time-slice.
A new measure value is calculated at the identified measure period and time-slice.
Note: The refresh rate just defines how often the calculation is executed. The above scenarios are only the result of the refresh execution and are not explicitly triggered.
In addition to the refresh rate, the Update Period defines how much data is updated in the measure table. For example, if you configure a Measure object with a refresh rate of 15 minutes and an update period of 1 hour, every 15 minutes, the AVEVA BI Gateway services update the last hour of data in the measure table.
Manage measures
The Measure editor allows you to:
Video tutorial: Introduction to AVEVA BI Gateway measures
Hello.
Welcome to the demo of the Measures object within the AVEVA BI Gateway Model Builder.
A measure is a group of calculations that shares the same context.
It consists of calculations for each source system, time period, and for each unique combination of dimension value.
Measures are typically numerical values computed from source systems and put into context with dimensions.
You can configure measures by defining which calculations need to be computed, along with the context (dimensions) to which the calculations are related.
Go to the Floating Action Button (FAB) and click ‘Measure.’
Enter the name and description as required.
Under ‘Refresh Rate,’ define how the measure instance will be executed.
The refresh rate recomputes calculations for the current time-slice and also verifies whether a new time-slice must be defined.
For this example, I will set the refresh rate as one hour with 15-minute offset.
This means that from the top of the hour, the dimension objects are refreshed every 1 hour and 15 minutes, and the measure is refreshed after the completion of all the dimensions refresh.
It is important to delay the refresh by 15 or 20 minutes, otherwise the dimension execution refresh will overlap with the measure refresh, and may cause temporary issues within the data consistency standpoint.
Next, define the ‘Update Period’ as required.
In addition to the Refresh Rate, the Update Period defines how much data is updated in the measure table.
For example, if you configure a Measure object with a refresh rate of 15 minutes and an update period of 1 hour, every 15 minutes the BI Gateway services update the last hour of data in the measure table.
The Measure Period is the largest bucket of time that the system considers for slicing the data.
You can configure a measure period, which forces the computation of the measure calculations at the specified period.
For example, a measure object configured with a measure period of one hour stores calculations in the measure table for every hour since the data collection start.
From the Measure Period, you can see smaller time slices with a given hour because of the influence of the contextual time-defining dimensions.
The ‘Data collection start’ parameter under ‘Data Backfill’ is the datetime that you would like to compute or to perform a reverse backfill computation that will compute all the calculations.
Typically, measure tables are updated with time, adding records for every time-slice defined by time-slicing dimensions and the measure period. As such, measure tables are updated incrementally,from the time defined by the data collection start-time.
The data collection starts from reverse up to the point of the specified data collection start-time.
So, it starts at the most recent time slices sticking, near real time and then it goes in reverse to reach the specified date.
Once you save the general input, go to the ‘Context’ tab.
Here, we will add the dimensions to configure for the Measure’s calculation context.
Please note, you would have had to create a context link relationship within an asset model dimension and a time-defining dimension prior to this process.
Click the button ‘Add Dimension.’
Select the asset model dimension from the context link relationship that you created earlier.
Click ‘Add Dimension’ once again.
This time, select the time-defining dimension from the same context link relationship.
In this instance, I choose WorkOrder_Dimension.
You can edit the alias as required.
It is recommended to keep the Foreign Key name as simple as possible, like removing the number.
Click the context link toggle button next to your asset model dimension.
Once enabled, this feature restricts the influence of time-defining dimensions on only the asset populated within.
You will not be able to click the toggle button next to your dimension in some certain cases due to dimension configuration missing.
You can create a calculation on your own.
Click ‘Edit Calculations’.
Click the Add + button.
Enter the calculation name and select ‘Aggregate’ as the calculation type; the calculation type is ‘aggregate’ when the calculation belongs to the function that you use for aggregating the data.
So, you have to select a given custom query that provides the right information from the data adapter.
Click the pencil icon next to Source Data Items, to select the custom query that provides the required information from the data adapter.
In this example, I will select the Insight custom query 'EnergyElectricity'.
Click the checkbox and click the toggle button to preview the source data.
Then, fill in the following criteria in this order: Function,
Calculation field, Return type, and Period field.
The next step is to define the context relationship mapping with the calculation result set: Save your calculation.
This brings us to the end of the demo video for the Measures object in the AVEVA BI Gateway Model Builder.
Thank you.
This video provides a brief overview of measure objects.