2. What is a Query?
• A Report?
• Another Way to Export Data?
• A Grouping of Records?
A query in Raiser’s Edge is a grouping of similar records
in the database. The query module enables us to group,
sort, and output different types of records.
2
3. Query Types and Formats
• A Query Type determines what kind of records you want
to group and see in your output
• A Query Format determines if the data will be a snapshot
or will refresh over time as the database changes
3
4. The Criteria Tab
• Define which group(s) of records you
want to pull from the database
• Each filter relates to a field in Raiser’s
Edge – the key to finding filters is to
know which field(s) on the record relate
to the information you want to group on
4
5. Criteria Nodes (Fields)
Frequently Used “Nodes” for Constituent Queries
•
•
•
•
•
•
•
Constituent Information: Biographical fields and record properties
Solicit Codes: Codes on the bottom left of the Bio 1 tab. Examples: Do Not
Contact For Visits, Do Not Solicit, Outstanding Pledge
Addresses: Preferred Address fields (There is a sub node of Phones that is
used to filter phone numbers and e-mail addresses)
Actions: Fields on a constituent’s actions record (type, date, solicitor, status)
Relationships: Assigned Solicitor, Education, Individual, Organization
Relationship fields
Gifts: Fields on a constituent’s gift records (date, amount, type)
Attributes: Information on constituent’s attributes. When querying on
attributes, there’s a sub node of Specific Attribute. From there, choose the
attribute you want to filter on
5
6. Query Criteria Tip
Query Favorites
• For query fields/criteria that you use
frequently, you can add them to your
favorites by Right Clicking on the field
and selecting “Add to Favorites”
• The Favorites node appears at the very
top of the criteria list and will include all
the fields that you have added as
favorites
6
7. Query Criteria Tip
Query Fields
Allows you to select any field that is
currently in your query. Use this to save
time when selecting your output fields or
sort field(s).
7
8. Query Criteria Tip
Summary Information
Allows you to select a summary of certain
fields (Gift, Honor/Memorial, Action, or
Appeal)
8
9. Criteria Operators
Operator
Example
Equals / Does not equal
Preferred State equals Texas
Greater than / Greater than or equal to
Gift Amount greater than $1,999
Less than / Less than or equal to
Gift Amount less than or equal to $100
One of / Not one of
Current Membership one of CC, CCEC
Between / Not Between
Gift Date between 09/01/12 and 08/31/13
Blank / Not Blank
Preferred Email Number not blank
Begins with / Does not begin with
Last Name begins with O
Contains / Does not contain
Note Description contains solicitation
Ask
This operator will ask for operator and
value when the query is ran
9
10. Combining Operators and Parentheses
Operator
Definition
Example
AND
Records must meet both criteria to be selected.
The default combining operator in Query.
Last Gift greater than 9/1/13
AND NetCommunity gift equals Yes
OR
Records can meet either criterion to be selected.
Last Gift greater than 9/1/13
OR NetCommunity gift equals Yes
Parentheses ( ) Needed when you have 3 or more rows and you
are using both AND & OR
Preferred State equals Texas
AND Last Gift greater than 9/1/13
OR NetCommunity gift equals Yes
Preferred State equals Texas
AND (Last Gift greater than 9/1/13
OR NetCommunity gift equals Yes)
10
11. Output, Sort and Results Tabs
• Output Tab: Select fields you want to view
• Sort Tab: Select field(s) you want to use to sort your data
• Results Tab: Preview Results
Note: From the Results Tab you can open any record by
double clicking on the row that corresponds to that record.
11
12. Query Tips and Tricks
Duplicate Records
• When viewing the results in a query, you could see
duplicate records if you have one-to-many fields in the
output or in your criteria
• If you see duplicates in your query, you can remove
them in your export file (excel/access for example) or
you can run the query through the Export Module which
will automatically de-duplicate your query
12
13. Query Tips and Tricks
Creating a Copy of an Existing Query
• If you see a query that has all or nearly all the criteria
that you need in it, instead of creating a new query from
scratch or changing that query (Never change a query
that you didn’t create), go to File > Save As and
rename the copy of the query for yourself
13
14. Query Tips and Tricks
Query Options
Tools Query Options
• General Tab: An overview of the basic query information
– Query Type, Format, Name, Category (folder), and Description
• Record Processing Tab: Details on filtering or limiting
– Select From Query: Create the current query from records included
in a separate query
– Suppress Duplicate Rows: Rows with the same data will be
eliminated
– Apply Output Limits: Constraints will only be applied when the query
is used as an input query
• Available only for Static Queries
14
15. Query Tips and Tricks
Query Options
Tools Query Options
• Gift Processing Tab: Details on how soft credits and
matching gifts will be handled
– This is a very important tab if you are looking at household giving,
including if a donor gave through an organization, etc.
• Advanced Processing Tab: The options on this tab are
generally not used very often
– Used for SQL coding and multiple attributes
15
16. Query Tips and Tricks
Exporting from a Query
• To export your query results to a file, click on the export
icon (looks like a CD) from the query tool bar
• Specify a file type (excel, CSV, access, etc…) and file
name (click on the ellipses to specify the name and
where you want to save the file)
Remember that the export tool from a query will output your results
exact as they appear (including duplicates) if there are any
16
17. Ways to Utilize Queries
Query Lists
• Link one or many queries to
a query list and then you
can add or remove specific
records
17
18. Ways to Utilize Queries
Constituent Search
• Search Using a Query – allows you to change the output
• You could also use this if you only search for
constituents in a certain criteria.
18
19. Ways to Utilize Queries
Querying with Exports
• You can export gifts using a particular gift query in a
constituent export. You can use this to filter down gifts
based not only on campaign, fund, or appeal, but on
attributes, codes, etc.
19
20. Ways to Utilize Queries
Canned Reports
• Link queries to Canned Reports to filter
which records you want to appear in
the report
• Under each canned report there is a
summary of what the report can run
and a link to view samples
of the report
20
21. Ways to Utilize Queries
Dashboard Panels
• Much like canned reports, dashboard panels can be
attached to a query to filter which records to shown
• Some Dashboard panels can be the query results, which
allows you to change the columns and sort however you
want to!
21
22. Ways to Utilize Queries
Clean Up Database
• With the BLANK query operator, you can create dynamic
queries (such as Address Line 1 blank).
• Make the output just the Constituent ID.
• Then go to the results tab and double click to open the
first record.
• Clean up or fix the data, Save and then click the arrow to
go to the next record.
22
23. Ways to Utilize Queries
Clean Up Database
• With the BLANK query operator, you can also create
Business Rules that will automatically help clean up your
database over time
• Create the query and attach it to a Business Rule and
then when a user tries to save the Record, it will pop up
informing the user to go back and fix the data
23
Notes de l'éditeur
A query in Raiser’s Edge is a grouping of similar records in the database. The query module enables us to group, sort, and output different types of records.
Whenever you begin to make a query these are the first two questions that need to be answered.When selecting a query type, ask yourself “What type of records do I want in the output”? Do I want to see constituent records, gift records, action records, fund records or other types of records? The Constituent type query is used most often and is used to group individual and organization records.The two query formats are dynamic and static. A dynamic query refreshes itself every time you run it, so if more or fewer records meet your criteria when you run the query in the future, then the new results will be reflected in your query. A static query is a snapshot of the records in a database. That means the results in your query will never change or be updated unless you manually refresh the query.
The grouping filters called “criteria” are the most important part of a query. This is where you define which group(s) of records you want to pull from the database. Each filter relates to a field, sub-record or property of a record. The key to finding filters is to know which field(s) on the record relates to the information you want to group on. So for instance, if you want to find all CC Members in the Odessa/Midland Region, you have to know where the CC Membership is stored and where Region is stored. Once you know how and where the data is stored, finding it in the query is the easy part.
There are nodes that represent different groups of criteria that you can use to group on. You see these in “Available fields” when you first open a query. Note that these Available Fields change based on the Query Type you have chosen.
Query favorites allows you to easily pick those fields that you pick often (like constituent ID or last name) when creating a query.
Query fields allows you to select any field that is currently in your query. Say you’re criteria says the constituent’s preferred address must be in either Austin, Dallas or San Antonio. Then in your output you want to include the city. Instead of finding the field preferred address city again, you can select Query Fields and the field will be right there. This is also great for sorting!
Allows you to select a summary of certain fields (Gift, Honor/Memorial, Action, or Appeal)A Field Criteria pop up appears to select criteria for the summary field
Criteria operators and values are used by the query to determine which records you want to pull for a specific filter. When you click on a filter from the criteria tab, you’ll see a pop-up with the operator and value selections.
At the bottom right of the query, you will see buttons for “AND”, “OR”, and left/right parentheses. These options are used for grouping criteria. When adding criteria, the system adds “AND” operators between criteria by default.Here is the query written without parentheses: Preferred State equals TexasAND Last Gift greater than 9/1/13OR NetCommunity gift equals YesThe query reads the OR operator first and will pull all residents of Texas who gave since 9/1/13 and all constituents who have a gift from NetCommunityregardless of what state they live in or what date the gift is. An OR operator without parentheses doesn’t associate with criteria above it.Here is the query written with parentheses: Preferred State equals TexasAND (Last Gift greater than 9/1/13OR NetCommunity gift equals Yes)This query pulls all residents of Texas who either (gave since 9/1/13 or gave through NetCommunity)
Once you have your criteria selected, you can go to the Output tab to select output fields for the constituents you grouped together on the criteria tab. The tab looks nearly identical to the criteria tab. To select an output field, double click it. You will then see that it moves over to the “output” section on the right. So for example, you may have grouped all CCEC Members in Houston Region on the criteria tab, but for those people, you want to see name, address, e-mail, and age.You would select those fields from the output tab.You can sort your output by any field(s) by selecting it on the SORT tab. The field list again is identical to the criteria and output tabs. If you plan on exporting the data, you’ll want to sort in the query the same way you want it to sort in the exported file.The Results tab is where you preview the results of your query (by clicking “Run Now” on the bottom right). It will display all the output that you selected from the output tab. Note- You can open any record in your results by double clicking on the row that corresponds to that record (this works for most query types).
When viewing the results in a query, you could see duplicate records if you have one-to-many fields in the output or in your criteria. So for example, if you output constituent code and a person has 4 constituent codes, four rows will appear for them in the results.If you see duplicates in your query, you can remove them in your export file (excel/access for example). You can also run the query through the Export Module which will automatically de-duplicate your query.
If you see a query that has all or nearly all the criteria that you need in it, instead of creating a new query from scratch or changing that query (Never change a query that you didn’t create), go to File>Save As and rename the copy of the query for yourself (much like you would an MS office file).
Query Type: A user may change the query type as long as the query does not currently contain fields that are invalid for that query type. For example, if the query contains the total amount field, that query cannot be changed to a gift query or any other query type because that summary field is available only for constituent, organization or individual queries. A general rule is that using summary field will prohibit that query from being changed to a different type.Query Format – Static or Dynamic: The format of a query may be changed to either static or dynamic. This ability is disabled for merged queries.Query Name: Displays the current name of the query, if one has been assigned; a query’s name can be changed at any time and may be up to 50 characters longCategory: Displays the current query categoryDescription: Allows the user to change the query’s description; holds up to 255 charactersSelect from query: This checkbox allows the user to create the current query from the records included in a query that has already been created, instead of searching the whole database. Marking the checkbox enables the binoculars icon, which loads the standard query search window.Suppress duplicate rows: This indicates whether duplicate rows (rows with exactly the same data) can be eliminated so there is only one row of that data.Apply output limits: This checkbox is enabled only if the query is a static query. For dynamic queries, it’s disabled. If a user selects options for this checkbox and then changes the query to a dynamic query, these options will be ignored during the processing of the query.If this checkbox is marked, the user may apply certain constraints that will be applied when the query is used as the input query for another function within the program. For example, assume the user specifies query criteria and also applies an output limit specifying that they want a random sampling of 15 records. If 80 records meet the criteria that the user specified, all 80 applicable records will be displayed on the Results tab of the query. However, if that query is chosen as an input query for some other process (e.g., Export, Mail, etc.), only the 15 records marked as part of the random sampling will be passed to that process. The other 65 records that met the criteria of the original query will not be looked at.Random sampling: Clicking the Apply Output Limits option will allow this option to be marked.Limit to top rows: Clicking the Apply Output Limits option will allow this option to be marked. Rather than a random sampling of X number of records as described above, this will limit the records to only the top X rows of the query results.
Gifts Processing Tab: This tab includes the options for how soft credits and matching gifts will be handled when processing the query. The user can optionally change these settings to apply soft credits or matching gifts to the donor, the soft credit recipients or matching gift companies, or both.Advanced Processing Tab: The options on this tab are generally not used very often, but here is a description of what they do.Use alternate SQL for code table fields: This optimization should really be used only in the case where there are many code tables fields in the output.Use alternate SQL for multiple attributes: This optimization option really only affects queries when there are a large number of attributes in the output. It is merely a different way of attempting the SQL statement in the backend of the database. The reason this checkbox shouldn’t always default to being marked is that sometimes it could slow a query’s processing down if there is only one attribute in the output.
To export your query results to a file, click on the export icon (looks like a CD) from the query tool barSpecify a file type (excel, CSV, access, etc…) and file name (click on the ellipses to specify the name and where you want to save the file)Remember that the export tool from a query will output your results exact as they appear (including duplicates) if there are any
Search using a query allows you to change the output and how the results are sorted. For this example, I was able to change the output to show the constituent ID, the constituent’s Name Tag name, the spouse’s Name Tag name, the constituent’s age, the constituent’s alma mater, and the constituent’s last gift date. You could also use this if you only search for constituents in a certain criteria. So if you only search and look at records that are CCEC members or their spouses, then you can link a query that has the criteria of a CCEC member or spouse. Or if you only want to look at people who have donated over a certain span of time, you can use that too. Or if you never look at organizations, etc. This can help a lot with those individuals that have the same name.
With the BLANK query operator, you can create dynamic queries (such as Address Line 1 blank).Make the output just the Constituent ID.Then go to the results tab and double click to open the first record.Clean up or fix the data, Save and then click the arrow to go to the next record.
With the BLANK query operator, you can also create Business Rules that will automatically help clean up your database over timeCreate the query and attach it to a Business Rule and then when a user tries to save the Record, it will pop up informing the user to go back and fix the dataThis could be used for Actions without a solicitor, for example.