Query

Query Overview

Queries are used to group records that meet a set of criteria you define. There are two types of query: ad-hoc and smart. Ad-hoc queries can include numerous output fields and enable you to browse through a specific set of records. Smart queries perform complex calculations that would be difficult to achieve using ad-hoc queries, and are based on templates included in the program. Additionally, the program features a third mechanism to group records — selections. Selections can be created from either type of query and include only record IDs. Selections are designed to be used by the program in various features and are optimized for processing speed.

Ad-Hoc Queries

By creating queries, you can select, group, and list records that meet a set of conditions you define. Ad-hoc queries serve two main purposes. They are a quick way to see data filtered to your needs and they enable you to produce selections for use in other processes throughout the program. If you are quickly checking data, you may get all the information you need from the output fields you select in an ad-hoc query. Or you may want to drill into an actual record to view more detailed data. In this case, when you only want to explore your data — rather than feeding this list of records into some other process — the program presents the first 500 of the actual query results (rather than all of them) because it is not intended as a means of visiting each record individually in a large result set.

When you use Query to produce a selection to be used by some other process, you are producing a set of IDs only. In many cases, you may create an ad-hoc query solely as a means of creating an accompanying selection. Although selections include no information about the records other than IDs, you can still pick a set of output fields in the query. This enables you to view a sampling of records so you can feel comfortable that the criteria you selected are accurate and the process will work on the records you intend. In this case, again only 500 of the actual query results display enough to provide you confidence in your query results.

Create Ad-Hoc Queries

When creating ad-hoc queries you must first specify the source view from which the query should be created. This determines the type of records that will be included in it. Then you can specify output fields and filter criteria for the query. You can use categories to group your queries. When you view ad-hoc queries, you can use filters such as Type or Category to limit how many queries are shown.