Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Counting Value List instances


This topic is 6956 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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?

Posted

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.

This topic is 6956 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.