2 Replies Latest reply on Mar 15, 2011 8:51 PM by DanielPackman

    Flexibility of a script but functionality of a calculation field?

    DanielPackman

      Title

      Flexibility of a script but functionality of a calculation field?

      Post

      I have a layout which has about 200 locations for information to print out. Most of these are to be filled in with counts corresponding to complex searches (eg, Male/Female, Hours worked > 0, age>40). These sort of operations seem to match well with operations available to me within regular scripts (particularly the Found Set category). But if I tie scripts to buttons, then every button would have to be triggered before printing out. Is there a way to trigger these buttons en masse or is this the wrong approach?

      If I set up a calculation field for each of these 200 locations, then the user interface issue seems right, but the sets of operations available to me for calculations doesn't seem to include performing finds and then counting records in the found set.

      Thanks for any insight.

        • 1. Re: Flexibility of a script but functionality of a calculation field?
          philmodjunk

          It may be possible to define either different relationships or some filtered portals to get what you want, but can't tell for sure without knowing in detail what the criteria are for these "finds".

          Count, used in conjunction with a relationship that only matches the current record to records meeting your "find" criteria is one possibility.

          Defining a "count of" summary field in the related table, and then setting a portal filter to limit the related records to only those that meet the criteria is another option if you are using FileMaker 11.

          And with either approach, a separate "report table" where each record can specify different criteria for either the relationship, portal filter, or both can allow you to combine counts for different and even overlapping groups of records in the same report.

          If the different "found sets" do not overlap, you may also be able to simply set up a summary report with sub totals (such as your counts) for each sub group of the total set of found records. (And this report need not list each individual record, just the group sub totals.)

          • 2. Re: Flexibility of a script but functionality of a calculation field?
            DanielPackman

            Thanks Phil. Your help on this forum is golden. The "count of" and "total of" fields in conjunction with filtered portals did the trick.