November 7, 200520 yr I'm sure this is simple, but it seems I haven't had enough coffee to see it.... On the main layout of a report form I have a Value List named TimeOfIncident for various school time periods-- value list values are Period 1, Period 2, etc. On a report layout I want to have a listing of how many records there are for each time period; I have a field defined for each period called Period1Count, Period2Count, etc. The report would show Period 1: 7 records Period 2: 2 records ...etc... - where the number shown is the value of Period1Count, etc. In English, the value of Period1Count equals the number of records where TimeOfIncident = "Period 1" But for the life of me, I can't figure out how translate this into a FM calculation; have been trying to set the values by Calculation in Define Fields, but w/o success. Calculations can't do Finds, so how do I find value matches?
November 8, 200520 yr There are two common methods for counting values in a field: Summary reports and counting related values. Here's a look at each: 1. Summary reports Add a summary field to the table where the TimeOfIncident field resides: Count of TimeOfIncident (summary) = Count of TimeOfIncident Then on a layout based on this table, add a Sub-Summary by TimeOfIncident part, and insert the TimeOfIncident field and the Count of TimeOfIncident field. When the records are sorted by TimeOfIncident and viewed in Preview Mode or Printed, the part will show with the counts for each period. 2. Counting related values This is usually used if the counts must be viewed while in Browse Mode. It requires a relationship for each possible value of TimeOfIncident that you want to see simultaneously (or one relationship to a separate table where each TimeOfIncident is a separate record.) How the relationships work depends on your structure. For the typical case of a Class-Section table (where each record is one particular period for a particular class,) relating to an Enrollment table (where each record is one Student's enrollment in a particular Class-Section,) the count is a simple calc field residing in the Class-Section table: Count of Enrollments (calculation, number result) = Count(Enrollment::StudentID) These could then be viewed in a list view, showing the enrollment counts in a list view, along with specifics about the Class and Section. If you have a different structure, or need more, let us know specifics of how your tables relate, and what you need.
Create an account or sign in to comment