Data Aggregation

Data aggregation is the process where raw data is collected, consolidated, and expressed in a summary form for statistical analysis. For example, data collected every minutes is aggregated into a value for an hour, data collected on an hourly basis is aggregated into a value for the day, and so on. Data aggregation allows patterns in the data to emerge, and these patterns acts as the basis for data analysis and decision making.

Aggregation is frequently called summarization, and aggregate data is called summary data. While the most frequently used aggregation operator is Sum, there are many other operators, such as Average, Minimum, Maximum, and Count. deviceWISE Cloud also supports Weighted Average and Non-zero time weighted average. Following are all the data aggregation supported by the deviceWISE Cloud:

deviceWISE Cloud Aggregations API notations (counter.count and property.aggregate Description
Average avg The average of the data values found within the specified time period. The avg calculation is determined by taking the sum of all publishes during the time period divided by the number of publishes during that period.
  • For Example: Torque values when tightening a bolt should be averaged, as each torque measurement is not related to the time between the measurements.
Weighted average wavg The time weighted average of the data values found within the specified time period. The wavg calculation is determined by weighting each publish for the number of minutes that it is the current value in the time period.
  • For Example: Power usage in a location should be tracked using a weighted average to determine the power usage over a given period of time.
Non-zero time weighted average nzwavg The non-zero time weighted average of the data values found within the specified time period. The nzwavg calculation is determined similarly to the wavg, except that instead of weighting across the entire time period in the series (1 hour or 1 day), it is calculated against the time in the period the value was non-zero.
  • Example: Calculating the average speed of a vehicle should use nzwavg so you only calculate the average speed while the vehicle is moving (ie drop the time while the vehicle is stopped).
Sum sum The sum of the data values found within the specified time period.
Minimum min The minimum data value found within the specified time period.
Maximum max The maximum data value found within the specified time period.
Count count The count of the data values within the specified time period.

Slicing the aggregate data

deviceWISE Cloud collects data in specific time intervals and presents the data within the context of those intervals. The property.aggregate slices the intervals into hour or day and the counter.count slices the interval into hour, day, 15 minute, 5 minute and total. You must use the proper time interval series to get the desired aggregate results. The below example explains the series that needs to be used in property.aggregate and counter.count API calls:

The first table below returns the sum for the entire day, since series is set to day. If you want to return the results only between 2:00:00 and 3:00:00 you need to set the series to hour instead of day. Other possible options for series includes 15min, 5min, or total.