Sorting Reports

Top  Previous  Next

You will also see a Sort button on the reports window. This option allows you to change the order of the data displayed on the report, if you want to see it in another order. For instance, suppose you want to list donations in descending order by amount. You might start by creating the Reports à Donation à All Donations à Sort by Name report. (I have provided a report sorted by Name, and one by Date, but not one by Amount.) Then click the Sort button. (Again, please do this as you are reading this page or it will be difficult to understand it!)

 

You will now see a window called Specify Sort Columns. Instructions are written at the top of the window. Basically, at the left is a box labelled "Source Data", which contains the names of all of the fields on the report that you can sort on. While the names displayed won't exactly match the column headings on the report, you should be able to figure out which is which. (You can always try some trial and error.)

 

In this case, you want to filter on the Amount column, and the obvious guess is a column called "amount". Click on that and drag it over to the box on the right labelled "Columns". You will see a checkbox to the right of where the name appears, labelled Ascending, which is checked. We want to see it in descending order, so click that checkbox to uncheck it. Now click on the OK button and it will sort your report in the order you requested.

 

You can even sort on more than one column by dragging a second column over from the "Source Data" list to the "Columns" list. When you do that, it first sorts by the first column listed, and then it only sorts on the 2nd column listed if the values in the 1st column are the same. For instance, suppose you have sorted on "amount" and "date_received". The report will mostly be sorted on the amount, but if there are two donations for $1,000, then those two will be sorted in order of date.

 

You can remove a column from the sort by dragging it back from the "Columns" box to the "Source Data" box. Please note, however, that if you remove all of the sort columns, the report won't necessarily go back to its original order. To get back to that order, Close the report and create it again from the Reports menu. Each time you create this report, it will be displayed in its original order. Your sort order from a previous run is not remembered.

 

A couple of reports will not work properly with arbitrary Sort orders. For those reports, the Sort button is disabled.

 

When you change the sort order, part of the header of most reports will change to reflect the new order you have chosen.

 

If you want to sort a report on the Member/Envelope number, you have to get a bit more tricky. First, in the Sort dialog, drag the column named "membernumber" over to the right. Then, double-click on it on the right, to bring up the Modify Expression dialog. You will see "membernumber" (without the quotes) in the big box at the top. Change that to:

       if ( isNull ( membernumber ), 999999999, membernumber )

Then click OK twice to apply the new sort. The reason for this is to force everyone with a Member/Envelope number to come out at the top of the report, and everyone without one to come out at the bottom. If all of your donors have Member/Envelope numbers, or you want those without one to sort to the top, just use the following instead:

       membernumber