Selecting records

Records may be selected by clicking on individual rows. The standard list selection operations may be used to adjust the selection (click to select a single record, Shift+click to select a range of records or CTRL+click to toggle individual records). Selected records are highlighted in blue. Selections on geo-relational tables will be immediately reflected in the Map Viewer window.

The Select All and Select None allow the user to quickly select all or none of the records contained within the table. The number of records selected is indicated in the top right corner of the Table Viewer screen. Switch Selection allows the user to toggle between the selected and unselected records.

This option is useful to obtain all the records that DID NOT meet specific requirements outlined in a query.

SQL Queries

Records may be selected using an SQL-like query tool to specify logical expressions based on attribute values. You can access the query tool from the Query Tool item under the Edit menu. A shortcut is provided on the main Patchworks window that accesses the query tool for the currently selected layer.

The query tool dialog box has a number of options for constructing specific queries. You can construct a query by clicking on the 'Field', operators, and 'Values' buttons, or by typing a query directly into the entry area at the bottom of the panel.

Figure 80. The Query Tool


All fields contained in the attribute table (both hidden and visible) are displayed in the Fields list. Clicking on a field from the list automatically adds that field in the query string.

By checking the "Show Values" box all possible values associated with the next selected field are displayed in the Values list.

Values can be incorporated into a query using any of the relational operators.

Query phrases can be negated using the "not" operator and combined using boolean operators "and" and "or".

Numeric operators may also be used to combine expressions (for example, "(A + B) < 10.0").

All queries must evaluate to a logical 'True' or 'False' condition.

A more detailed discussion of the Query Language can be found in Patchworks Query Language. This section describes data types, expressions, functions and helpful examples.

The query dialog also allows the user to chose a specific period to apply when querying dynamic information. By default the initial setting of the period control will be the same as the period selected for the Table Viewer.

To run the query click on one of the New Set, Add to Set, or Select from Set options on the lower right of the query tool panel. The "New Set" option will clear the current selection and replace it with the results of the query. "Add to Set" will add the results of the query to the current selection. "Select from Set" will choose records only from within the currently selected records.

SQL queries operate over all records in the attribute table. It can be difficult to scroll to the correct location to find the results of the selection, especially if the query was extremely specific and yielded only a few records in a large dataset. The Promote Selected command under the Edit menu or on the toolbar will bring the selected records to the top of the attribute table for easy access.