Trend Views

A trend view displays query results as a set of time-series data, that is, a graph with Time as the X-axis, allowing users to monitor the changes of fields over time. Some chart views can be customized to approximate this functionality, but trend views are much more naturally suited to displaying time series data and have been optimized for this purpose. Trend views are unique in that they can only be viewed on the Trend Viewer page, whereas the system can display all other view types at least as their own Report Pages. The Trend Viewer page provides an environment in which a trend view's optimization for time can fully be brought to bear, as most of this functionality would be lost by allowing a user to access a view in the generic environment of the View Report page.

As a trend view is optimized to represent the values of different fields over time, the first step in constructing a trend view is to select a Trend Time Variable, a Calendar-type field to use as the X-axis in displaying all trends; if no field of this data type exists among the selected target fields of the query, you will be unable to create a trend view. The requirement to explicitly define a Trend Time Variable not only ensures that a time series exists, but also provides clarification in the case that multiple Calendar-type fields are selected among the query targets.

The block for building a Trend view on the Queries & Reports page.

Once you select a single time variable for all trends in the view, you can then create Trend Measures, or the data sets that will be tracked along the selected time series. A Trend Measure consists of two main components: an Aggregation function and a Value.

The New [Trend] Measure Panel.

The Value attribute, intuitively, specifies which variable or expression will be displayed against every point in time returned in the Trend Time Variable series; in the first screenshot above, the trend measure will display the change in Temperature over time. The Aggregation field, on the other hand, determines how the system handles multiple query results with the same value for the Trend Time Variable. For example, the system can receive multiple messages from the same device within the same second, and so a corresponding "Device Message" activity type would have two instances with the same time value. If a trend measure on the Temperature field of this activity type were to rely only on the raw query results, it would be ambiguous which value between these two activities to display on the final report. Instead, the Aggregation function of the trend measure dictates that the system will display one of the following:

In essence, when the system displays a trend view at runtime, it groups query results together into buckets based on the Trend Time Variable, calculates the aggregations defined in each trend measure, and displays these on a graph. At runtime, a user can select the time period for which to display the values of a trend view; this time period, in conjunction with the Default Rows attribute of the view, determine the granularity displayed by the trend view. For example, a trend view displaying values over an entire year, with no Default Rows attribute specified, would not display on its X-axis every unique value of the Trend Time Variable returned by the query.

Like all view types, trend views can include criteria over the selected fields of the query targets (though this experience is different on the Trend Viewer page). However, in order for a query criterion to be accessible on the Trend Viewer page, you must mark the criterion as "Trended" on the Add or Edit Criteria panel. There are many more unique details to using the Trend Viewer page to access trend views at runtime, but these are all covered on the Trend Viewer page.