Filter
For example, you may wish to look at all the gold values greater than half a gram. In this case you would set up a filter to look at the field containing gold grades (in the file) and only show those records in which the value is greater than or equal to half a gram.
In Expression mode:
Filters are evaluated using the rules and precedences that apply to field expressions.
In Classic mode:
Filters are evaluated differently depending on the source data type (Character, Numeric, Binary or Date), the conditions entered into the filter grid (text, number, alphanumeric or blank), and the state of the Numeric check box.
Text containing numbers is handled in a logical way when making a greater than (or equal) or less than (or equal) comparison. The text DH100, for example, is considered greater than the text DH2; and DH2 is considered less than the text DH003.
Filter conditions that contain non-numeric values such as wildcards (for example, Equal 2018*) always trigger an alphanumeric check on Character or Numeric fields.
The meaning of REAL field values will change based on the state of the Numeric check box:
- When the Numeric check box is enabled, the value is compared at its full precision and wildcards are not supported.
- When the Numeric check box is disabled, the formatted number (as defined by the number of decimals) is compared. Wildcards are supported, but they are only valid for the Equal and Not equal operators.
The meaning of DATE field values will change based on the state of the Numeric check box and (with the exception of dates in ISO format) the locale.
- When the Numeric check box is enabled, the underlying OLE date number value is compared and wildcards are not supported.
- When the Numeric check box is disabled, the formatted date is compared alphanumerically. Wildcards are supported, but they are only valid for the Equal and Not equal operators.
If you are working in multiple regions, it is recommended that you enter a filter value in ISO format, irrespective of the format of the dates in the Source file.
This table summarises the various filter comparisons:
Field Type | Filter Comparisons | |
---|---|---|
Numeric enabled | Numeric disabled | |
Character Numeric | Numeric portion extracted from the field and used for comparison; other text is ignored. Blanks treated as NO DATA. | Formatted field content is used; numerical values treated as text. Blanks treated as text. |
Binary Real | Number is compared at full precision of the data (ignoring displayed decimals). | Number is compared using the displayed decimals (as defined in the file). |
Binary Short Binary Long | Number is compared as displayed. | Number is compared as displayed. |
Formatted Date Formatted Date/Time | The underlying OLE date number is compared. | Formatted date content is used; numerical values treated as text. |
Applying a filter
There are three ways of applying a filter:
- From any of the data processing and display forms that contain a Filter check box e.g. Drillhole Validation, Grid Transformation etc.
When you create a filter, you assign it a number between 1 and 999.
To recall an existing filter, select the Filter check box and enter the filter number in the prompt adjacent to the Filter check box. Alternatively, double-click to select from a list of filters.
If you want to create a new filter or modify an existing filter, right-click in the Filter field and select New or Edit from the right-click menu.
The Filter form will open, allowing you to enter or modify the parameters of the filter. You can load other saved filters, modify their parameters and save them.
- By selecting a Filter option on the File | File Editor tab, in the View group.
When you attach a filter it is applied by default and the Filter icon is highlighted. You can click on Filter again (or press CTRL + F4) to toggle the filter off.
When you attach the default filter, the
When a filter is applied all records that do not pass the filter are shown as shaded. Most tools and functions in the Editor will only operate on the filtered (non-shaded) records.
Select Use Filtered Records (CTRL + F4) to operate on filtered records only:
Select Hide Filtered Records to hide the (shaded) records that do not pass the filter. Select the same option again to show those records:
- By selecting a Filter option on the File tab, in the Filter group.
In this case, you can create a new filter using all of the facilities described for the first two cases. However, you can also subset filtered records:
You can also save the records that pass the filter, in a separate file:
Another option allows you to delete records from a file based upon a set of filter conditions. The function immediately deletes the selected records:
You can also create more complex filters involving multiple fields. For example, you may wish to show those gold grades greater than half a gramme in a particular rock type. In this case, set the filter to show the gold grades greater than or equal to half a gramme and the rock type equal to whatever the text string is that defines a particular rock type (e.g. Qtz).