1 Reply Latest reply on Jan 14, 2014 6:59 AM by philmodjunk

    Count records with specific value in a field

    AlainJanquart

      Title

      Count records with specific value in a field

      Post

           Hello,

           I want to count the number of records where a field with label 'location' contains a specific location.

           Until now I can only count all the records.

           How can I do that in FM11 Pro?

            

           Thanks in advance

            

           Greetings

            

           lainkes

        • 1. Re: Count records with specific value in a field
          philmodjunk

               There are multiple methods for doing that. Which is best depends on your layout design, your table/relationship design and what you need to do with these counts once you have them.

               The simplest approach is a summary report. In layout mode, you add a sub summary layout part "when sorted by" your location field. Place your "count of" summary field in this layout part, sort your records by Location, select "List View" as the viewing option and you'll get a sub total count for each location. If you delete the body from this layout, you'll get one row of data for each location.

               By using different sort orders that still include the location field and by pulling up different found sets, you can get a number of similar but different reports all from the same layout.

               Other approaches use a related table of locations or  use ExecuteSQL to produce such subtotals.