Query Modifiers
Query modifiers are used for retrieving data that has been stored in the archive. They are used along with sampling and calculation modes to get a specific set of data.
When using query modifiers, specify #Query Modifier
as the Query Criteria String. For example, if the query criteria string is to retrieve only good data quality values, then you should specify #ONLYGOOD
as the Query Criteria String.
Query Modifier | Results |
---|---|
ONLYGOOD | The ONLYGOOD modifier excludes bad and uncertain data quality values from retrieval and calculations. Use this modifier with any sampling or calculation mode but 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 with those. |
INCLUDEREPLACED | Normally,when you query raw data from Historian, any values that have been replaced with a different value for the same timestamp are not returned. The This modifier is only useful with rawbytime or rawbynumber retrieval. Do not use it with any other sampling or calculation mode. |
INCLUDEDELETED | The INCLUDEDELETED modifier 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 any non-deleted values during the query time period.This modifier is only useful with |
ONLYIFCONNECTED/ONLYIFUPTODATE | The ONLYIFCONNECTED and ONLYIFUPTODATE modifiers can be used on any sampling or calculation mode to retrieve bad data if the collector is not currently connected and sending data to the archiver.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 | The ONLYRAW modifier retrieves only the raw stored samples. It does not add interpolated or lab sampled values at the beginning of each interval during calculated retrieval such as average or 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 | The LABSAMPLING modifier 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. An average from 2 P.M to 6 P.M on a one hour interval will interpolate a value at 2 P.M., 3 P.M., 4 P.M, and 5 P.M and use those in addition to any stored samples to compute averages. When you specify |
ENUMNATIVEVALUE
| The ENUMNATIVEVALUE modifier 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 |
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 |
FILTERINCLUDEBAD | Typically 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 query modifier is not always recommended. |
USEMASTERFIELDTIME | The USEMASTERFIELDTIME query modifier is used only for the MultiField tags. It returns the value of all the fields at the same timestamp of the master field time, in each interval returned. |
HONORENDTIME | Normally, a query keeps searching through archives until the desired 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 In cases where you want to specify a time limit, you can do this by specifying 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 |