Advanced Filtering: Advanced
The Advanced Filters Dialog when Filter By is set to Advanced is shown in the following figure:
When you open this dialog, you will only see filters that have been defined for the type of object you are trying to filter (e.g. Bus, Generator, Interface, etc.). You can choose a filter from the Filter Name drop-down box showing the list of filters available, or you can create a new filter. To make a new filter, simply click on Save As to save a copy of the present filter under a new name and then specify the properties of the filter as discussed below. When you have specified the filter as you wish, click Filter.
When this dialog is opened from a location where an Advanced Filter is not already applied, Filter Name will be blank and the default is to assume that a new filter should be created.
Advanced filters are stored with the case file when the case is saved. In addition, the filters can be exported to a Simulator Auxiliary File for storage and import into other cases. A list of all advanced filters defined for a case can be viewed in the Advanced Filters case information display.
To create an Advanced Filter you must specify the following things:
Filter Name
A string that uniquely names the filter so that it can be referenced from other dialogs. Filter names must be unique for each object type but do not have to be unique across different object types.
Condition 1, Condition2, etc.
Describes the conditions of your filter. To define a condition:
- Specify the field you are filtering. The drop-down list will open an embedded field chooser with useful options for finding the desired field. The Find button will open a very similar field chooser dialog.
- Specify the comparison operation such as between or greater than.
- Specify the values to which the field is compared. Depending on the comparison operation, either one or two values are needed.
- Select ABS to use the absolute value of the field value in the comparison operation. For Fields that are strings, select Case Sens. to make the comparison case sensitive.
Noteworthy comments about defining conditions:
- The comparison operation within integer range list uses the same format as described in Entering a Range of Numbers.
- To add or delete conditions click on the Add>> or Delete… button. You can also delete an individual condition by clicking on the X button next to the condition.
- There is no limit to the number of comparisons you can use for the Advanced Filter.
Logical Operators
The following describes how the filter uses the conditions that are specified such that the filter itself is met:
- AND means that all conditions should be true
- Not AND is the opposite of AND (i.e. any one of the conditions can be false)
- OR means that any one of the conditions can be true
- Not OR is the opposite of OR (i.e. all of the conditions must be false)
- Added in Version 19 XOR will return true if an odd number of conditions are TRUE
- Added in Version 19 One TRUE will return true if exactly one of the conditions is TRUE
- Added in Version 21 Num TRUE will return true if the specified number of conditions is TRUE
To use different logical operators within the same filter, refer to the Using Different Logical Operators section below.
Pre-Filter using Area/Zone/Owner Filters
When this box is checked, data is filtered first by the Area/Zone/Owner Filters and then by the Advanced Filter, therefore the data must meet both the Area/Zone/Owner Filters and the Advanced Filters in order to be shown. When this box is unchecked, the Area/Zone/Owner Filters are ignored.
Keep in mind that using this option will change how the filter behaves when Area/Zone/Owner filters change. Area/Zone/Owner filters are often used as a quick way of filtering. To ensure that a filter is not dependent on something that can easily change, it is best to include conditions on Areas, Zones, Owners, and Data Maintainers directly in the filter and refrain from using this pre-filter option.
Enable Field to Field Comparisons
When this box is checked, it is possible to compare two fields of the device or a field with a Model Expression. The dialog will be modified to show a drop-down with options for the type of field to use in the comparison, and the Find button will appear to make it easier to search for a particular field. In the drop-down Field indicates a comparison of a field for the same device and Expression indicates a comparison to the named Model Expression. If no Model Expressions have been defined this option is not available.
The following depicts what a particular condition looks like when the Enable Field to Field Comparisons checkbox is checked:
Using Different Logical Operators
Once a logical operator is chosen, that operator is used for all conditions in the filter. Therefore if you wish to use the AND operator, all conditions you define will be combined using AND. Nested filters are used to combine different conditions in the same filter with different logical operators. In other words, one condition of a filter can be that another filter is met. This allows you to define some conditions using one logical operator in one filter, and then use that filter to combine those conditions with other conditions using a different logical operator.
For example, consider the logical comparison of A and (B or C). To replicate this, you would define one advanced filter (AF1) that contains the logic B or C. Then you can define an advanced filter (AF2) that uses AF1 as A and (AF1).
To refer to one filter from within another, check the Use Another Filterbox. When using another filter the comparison operations that are available are meets filter and not meets filter. The comparison value box will turn into a drop-down that contains all defined filters that are applicable for the object type of the filter. The Find button can be used to open a dialog that will make it easier to search for filters. Device filters that use a particular object as a means of filtering can also be used as another filter. To use a device filter the string of the format <DEVICE> objecttype 'key1' 'key2' 'key3' should be entered in the comparison value box.