Query Modifiers
Query modifiers are used to retrieve data that has been stored in the archive. They are used along with sampling and calculation modes to get a specific set of data.
If you want to use a query modifier, when you create or modify a query, in the Query Criteria String field, enter #, and then enter the query modifier. For example, if you want to retrieve only good data quality values, enter #ONLYGOOD.
Query Modifier | Results |
---|---|
ONLYGOOD |
Excludes bad and uncertain data quality values from retrieval and
calculations. Although you can use this modifier with any sampling or calculation mode, it is most useful with raw and current value queries. All the calculation modes such as minimum or average exclude bad values by default, so this modifier is not required in those cases. |
INCLUDEREPLACED |
Normally, when you query raw data, any values that have been
replaced with a different value for the same timestamp are not
returned. The This modifier is only useful with the rawbytime or rawbynumber retrieval. Do not use it with any other sampling or calculation mode. |
INCLUDEDELETED |
Retrieves the value that was previously deleted. Data that has
been deleted from the archiver is never actually removed but is
marked as hidden. Use the INCLUDEDELETED modifier
to retrieve the values that were deleted, in addition to the current
values.This modifier is only useful with the rawbytime or rawbynumber retrieval. Do not use it with any other sampling or calculation mode. |
ONLYIFCONNECTED and
ONLYIFUPTODATE |
Retrieve bad data if the collector is not currently connected and sending data to the archiver. You can use these modifiers with any sampling or calculation mode. The bad data is not stored in the IHA file but is only returned
in the query. If the collector reconnects and flushes data and
you run the query again, the actual stored data is returned in
the following situations:
|
ONLYRAW | Retrieves only the raw samples. It does not add interpolated or lab sampled values at the
beginning of each interval during calculated retrieval such as
average, minimum, or maximum. Normally, a data query for minimum value will interpolate a value at the start of each interval and use that together with any raw samples to determine the minimum value in the interval. Interpolation is necessary because some intervals may not have any raw samples stored. Use this query modifier with calculation modes only, not with raw or sampled retrieval like interpolated modes. |
LABSAMPLING | Affects the calculation modes that interpolate a value at the start of each interval. Instead
of using interpolation, lab sampling is used. When querying highly
compressed data, you may have intervals with no raw samples stored.
For example, an average from 2 pm to 6 pm on a one-hour
interval will interpolate a value at 2 pm, 3 pm, 4 pm, and 5 pm,
and uses those in addition to any stored samples to compute
averages. When you specify |
ENUMNATIVEVALUE
| Retrieves the native, numeric values such as 1 or 2 instead of string values such as on/off
for the data that has enumerated states associated with it. You can use this modifier with any sampling or calculation mode. |
INCLUDEBAD | Normally, when you query calculated data from Historian, only good data quality raw samples
are considered. INCLUDEBAD modifier includes bad
data quality values in calculations.You can use this modifier with any sampling or calculation mode. |
FILTERINCLUDEBAD | Normally, while filtering, we use only good data quality values. When we use
FILTERINCLUDEBAD , the bad data quality values
are considered when filtering to determine time ranges. This
modifier is not always recommended. |
USEMASTERFIELDTIME | Returns the value of all the fields at the same timestamp of the master field time, in each interval returned. It is used only for the multi-field tags. |
HONORENDTIME | Normally, a query keeps searching through archives until the required number of samples has
been located, or until it gets to the first or last archive.
However, there are cases where you would want to specify a time
limit as well. For example, you may want to output the returned data
for a RawByNumber query in a trend page, in which
case there is no need to return data that would be off page.If
you want to specify a time limit, provide an end time in your
|
EXAMINEFEW | Queries using calculation modes normally loop through every raw sample, between the given
start time and end time, to compute the calculated values. When
using Using this query modifier is recommended
when:
Use this query modifier only with
|