Tag Historian Query
Tag Historian Query
Watch the videoThe Tag Historian Query provides a simple way to query data from Tag Historians. In the Tag History Query you can read data from Historical Tags for specific date ranges, apply aggregates, and specify the sample size. It functions the same as a Tag History Binding and uses the same interface, so check out that page for more information on the individual properties.
Using Parameters in a Tag History Query​
The only difference between a Tag History Binding and the Tag History Query is when using indirection. In the Tag History Query, indirection is inserted directly into the tag path in the Selected Historical Tags section.
Assume we have a parameter named StationNumber:
Indirection is typically done using a parameter which like the rest of reporting, is the name of the parameter enclosed in { }. In the example below, the parameter 'StationNumber' is inserted into the tag path in place of the station number. Note that you need to manually type out the name of the parameter, including exact spelling and capitalization.
Assuming base tag paths like the following:
[~]station 1/paint pressure
[~]station 1/paint fill level
we can replace the "1" with a reference to StationNumber:
[~]station {StationNumber}/paint pressure
[~]station {StationNumber}/paint fill level
Click here to learn more about Tag Historian Query Syntax on the Gateway Configuration File Reference page.