1 Reply Latest reply on Mar 29, 2012 2:19 PM by philmodjunk

    sorting by content of a summary field



      sorting by content of a summary field


      I have tried to sort records according to the contents of a “Summary” field. That appears not possible.

      My FMP9 file has two relevant tables: Contacts and Donations.  Each contact record may have multiple related donation records.  The sum of all donations by a specified contact is shown in the “donation_summary” field.  The field type is Summary. The donation_summary field is present in both Contacts and Donations layouts, and the data shown are correct.

      However, I now realize I am not able to sort a found set of Contacts records (or Donations records) by the contents of the donation_summary field, which is grayed-out in the list of sort options. Is there any workaround here? Maybe use a Calculation-type field to get the sum of a contact’s donations?


        • 1. Re: sorting by content of a summary field

          A calculation using Sum ( RelatedTable::Field )

          could be defined in Contacts to compute the total donations. You'll be able to sort on that field.

          You can also produce the same sorted list in a layout based on the donations table and this does not require adding another field to your solution.

          Set up a list view layout based on Donations. Remove the body layout part and replace it with a sub summary part "when sorted by" Contact ID or a name field from the contacts table. When you sort your records for this report, sort them by this specified "when sorted by" field, but then select the "Reorder based on summary field" option to order the records by the total donated.

          Both options work and one is probably about as fast as the other, but using the summary report based on Donations gives you some options not as easy to do from a contacts layout. YOu can further liimit the records used in your totals to a specific date range or you can include totals that break down the giving by month or quarter if such is useful to you. On the other hand, A report from the contacts layout can include contacts that have made no donations--showing a zero total donation, where the donations based report will omit them.