Query filters can be used to select or view a subset of rows in a table. When used on a collar table, this amounts to selecting collars. When used on an interval table, measurement intervals are selected. Query filters can be used to model using a subset of data and to filter information displayed in the scene window.
A query can be created for any type of table in a project, including GIS data, points data and structural data.
When a query filter has been defined for an object and the object is displayed in the scene, the query filter can be applied by clicking on the object in the shape list and selecting the query filter in the shape properties panel:
For a drillhole data table, this displays only the data selected by the filter. The trace lines remain displayed in the scene. To filter trace lines, tick the Filter trace lines box:
Query filters defined for collar tables are available to all other drillhole data tables.
To create a query filter, right-click on the required table in the project tree and select New Query Filter. The Query Filter window will appear:
Type the required criteria into the Query box, using the query syntax described below. Press Ctrl-Enter for a new line in longer queries. Click the ... button for more advanced query building options, which are described in Building a Query and Advanced Query Building.
Assign the filter a name and click OK to save it. It will appear in the project tree under the table to which it applies. To apply a query filter to the scene, select the object in the shape list, then select the filter from the Query filter dropdown list in the shape properties panel:
In this case, because the query filter was created for the collar table, it is also available for the lithology table.
The Leapfrog Geo query syntax is based on the WHERE clause of the Structured Query Language (SQL) with some restrictions:
- Unary operators are not allowed
- SQL functions cannot be used
- The SELECT statement should not be used (as in 'holeid in (SELECT holeid FROM ...)')
- Following statements are also prohibited: CASE, WHEN or MATCH
There is also one main SQL extension:
- IN and NOT IN will accept a partition group for the value list. E.g. 'zone IN layers.weathered' where "layers" is a partition of the "zone" column that has a group called 'weathered'.
These are some examples of valid Leapfrog Geo query statements:
- holeid in ('m-001', 'm-002')
- holeid not in ('m-001', 'm-002')
- holeid not like 'MAR%'
To enter a query that contains an apostrophe, enter two apostrophes. For example, the following query will result in an error:
Adding the second apostrophe results in a valid query:
The Query box allows the following shortcut queries:
- Typing a single word will match all hole-ids starting with that string. For example, typing "MAR" is a shortcut for "holeid like 'MAR%'"
- Typing a comma-separated list of words will match all hole-ids that exactly match the given words. For example typing "M001, M002" is a shortcut for "holeid in ('M001', 'M002')".