In This Article:

    Using Aggregates in Queries

    In This Article:

      Aggregation allows you to determine the Minimum, Maximum, Average, Sum, or Count of any numeric field. It will also allow you to List items in a single column such as listing multiple groups a constituent belongs to or multiple donations a constituent has made in a single field instead of listing the same constituent many times if they belong to many groups or have made multiple donations.

      1. See the Creating a New Query section of this document for instructions on beginning your query.

      2. Running a donation type query, filtering on a specific date range, asking for gift amount and donor name and not using the aggregate filter would return results similar to the example to the right. Notice the multiple results returned for Susan Andrews, Martha Arnold, George Clooney and Jane Davis.  

      1. To list donations from a constituent on one line, right click on the field, in the Available Fields list, on which you would like to filter (in this instance Donation Amount is being used). Choose Aggregate, and then Sum, Minimum, Maximum, Count, Average or List.                                            

      2. The Select Group By Field dialog box opens. Select the field you wish to group by, such as Donor ID to group by donor and then choose OK. An italicized field for the aggregate is added to the Output Fields list. The example below shows donors with multiple gifts where all of their donations have been listed on a single line. (You could also use List to associate an aggregate to a particular text field.)       

      5. Another example of aggregation is totaling donations per person:

      Create a Donation type query. From the Available Fields panel select the information you would like to see in the results of the query. Your choices will be displayed in the Output Fields panel. Add any necessary filters to your information. The example below shows results generated before aggregating the donation information.         

      To sum the donations of the donors you must select Donation Amount from Available Fields and then right click and select Aggregate > Sum.                                                                                           

      The Select Group By Field dialog box opens. Select the field you wish to group by, such as Donor ID to group by donor and then choose OK. An italicized field for the aggregate is added to the Output Fields list.

      The results returned in the query will now display donors on an individual line with the sum of their donations displayed. See the example below. You can see that DonorPro summed all of the individual’s donations which were returned in the previous query and listed the sum on one line.          

      See the Creating a New Query with a General Purpose section of this document for further instructions on creating a query.

      Was this article helpful?
      0 out of 0 found this helpful
      Have more questions? Submit a request

      Comments

      0 comments

      Please sign in to leave a comment.