RelativeHistoryQuery (Relative History Query)

This query works in conjunction with a RelativeJsonSchema.
Figure 63.   RelativeHistoryQuery properties
Image

You add a RelativeHistoryQuery under the Queries folder in the RelativeJsonSchema. You access these properties by double-clicking the RelativeJsonSchema node in the Nav tree and expanding the Queries folder.

Property Value Description
Last Result Size read-only (defaults to 0) Reports the size of the query result the last time the framework executed the query.
Query Pattern bql Prepends to a bql query so query data can be included in the payload for a given set of points or devices.

For example: %baseHistoryOrd%?period=today|bql:select timestamp, value

Example

Here is an example of how to use the Query Pattern property to pre-pend the current base item to a bql query. This example includes query data in the payload for a given set of points or devices:

%baseHistoryOrd%?period=today|bql:select timestamp, value

You may use this with a base query to return a HistoryConfig or a HistoryExt (or the parent of these slots):

station:|slot:/JsonExampleComponents|bql:select * from history:HistoryConfig
 
CAUTION: When creating queries, bear in mind the potential performance implications of running queries frequently. To reduce the scope of the query, focus the first part of the ord on the location where the data are likely to be found, or use the stop keyword to prevent depth recursion.