Query Qualities: Output Limits
Did you know it’s possible to apply output limits in query? This feature can come in handy when you need a random sample of records, or a set number of records that meet your criteria.
The option to apply output limits is only available in a Static query. After establishing your criteria, you can narrow down your results by going to Tools, Query Options, Record Processing and marking Apply output limits. There are two types of output limits: Random sampling and Limit to top rows. The following examples demonstrate how each can be used.
Random sampling:
Your boss asked for a list of 25 random people who gave a gift of $100 or more last year:
- Create a Constituent Static Query
- Filter on Gift Amount is greater than or equal to $100 and Gift Date equals last calendar year
- Go to Tools , Query Options , Record Processing and mark Apply output limits: Random Sampling and type 25 for the number of records to include
- Run the query
Note: Your output will show all records that meet your criteria. In order to view the list of 25 constituents, open a new constituent Export and include this query on the General tab.
Limit to top rows:
If something more specific is requested, such as the top 5 constituents who donated $100 or more last year, then you can limit to the top 5 rows using this function.
- Create a Gift Static Query
- Filter on Gift Amount is greater than or equal to $100 and Gift Date equals last calendar year
- Go to Tools, Query Options, Record Processing and mark Apply output limits: Limit to top rows, Limit to 5
- Sort the query by Gift Amount (Descending)
- Run the query
Note: Your output will show all records that meet your criteria. In order to view the list of 5 records, open a new Gift Export and include this query on the General tab.
These are just two of the secret talents of queries...