Filter Parameters for Data Queries

Use of filter parameters with a data query is optional.

ParameterDescription
Filter TagThe single tag name used when applying the filter criteria.

You can enter your filter conditions using Filter tag, Filter Comparison Mode, and Filter Comparison Value or you can put that all that information in a single FilterExpression.

Filter ExpressionAn expression which includes one or more filter conditions. The type of conditions used are:
  • AND Condition
  • OR Condition
  • Combination of both AND and OR

Filter Expression can be used instead of FilterTag, FilterComparisonMode and FilterValue parameters. While using FilterExpression, the expression is passed within single quotes and for complex expressions we write the conditions within a parenthesis. There is no maximum length for a filter expression, but if it is called using OLEDB or Excel, they may have their own limitations.

Filter ModeThe type of time filter.

The Filter Mode defines how time periods before and after transitions in the filter condition should be handled.

For example, AfterTime indicates that the filter condition should be True starting at the timestamp of the archive value that triggered the True condition and leading up to the timestamp of the archive value that triggered the False condition.

ExactTime
Retrieves data for the exact times that the filter condition is True (only True).
BeforeTime
Retrieves data from the time of the last False filter condition up until the time of the True condition (False until True).
AfterTime
Retrieves data from the time of the True filter condition up until the time of next False condition (True until False).
BeforeAndAfterTime
Retrieves data from the time of the last False filter condition up until the time of next False condition (While True).
Filter Comparison ModeFilter Comparison Mode is only used if Filter Tag is filled in.

The Filter Comparison Mode defines how archive values for the Filter Tag should be compared to the Filter Value to establish the state of the filter condition. If a Filter Tag and Filter Comparison Value are supplied, time periods are filtered from the results where the filter condition is False.

The type of comparison to be made on the filter comparison value:
Equal
Filter condition is True when the Filter Tag is equal to the comparison value.
EqualFirst
Filter condition is True when the Filter Tag is equal to the first comparison value.
EqualLast
Filter condition is True when the Filter Tag is equal to the last comparison value.
NotEqual
Filter condition is True when the Filter Tag is NOT equal to the comparison value.
LessThan
Filter condition is True when the Filter Tag is less than the comparison value.
GreaterThan
Filter condition is True when the Filter Tag is greater than the comparison value.
LessThanEqual
Filter condition is True when the Filter Tag is less than or equal to the comparison value.
GreaterThanEqual
Filter condition is True when the Filter Tag is greater than or equal to the comparison value.
AllBitsSet
Filter condition is True when the binary value of the Filter Tag is equal to all the bits in the condition. It is represented as ^ to be used in Filter Expression.
AnyBitSet
Filter condition is True when the binary value of the Filter Tag is equal to any of the bits in the condition. It is represented as ~ to be used in Filter Expression.
AnyBitNotSet
Filter condition is True when the binary value of the Filter Tag is not equal to any one of the bits in the condition. It is represented as !~ to be used in Filter Expression.
AllBitsNotSet
Filter condition is True when the binary value of the Filter Tag is not equal to all the bits in the condition. It is represented as !^ to be used in Filter Expression.
Alarm Condition
Specifies an alarm condition to filter data by. For example, Level.
Alarm SubCondition
Specifies an alarm sub-condition to filter data by. For example, HIHI.
Filter Comparison ValueFilter Comparison Value is only used if Filter Tag is filled in.

The value to compare the filter tag with when applying the appropriate filter to the data record set query (to determine the appropriate filter times).