Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Counting the number of occurrences of a particular value in a field in another table


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

Recommended Posts

Posted

If it possible I need to come up with a calculation that when a new record is created in Table 1 it counts the number of occurrences of a particular value in a field in another Table 2. In other words when a new record is created in Table 1 I get a calculated value that counts the number of times the value "Active" appears in a particular field in Table 2.

How do I go about doing that?

I know I can get this count by drawing a relationship between the two tables and counting the records that way but I wondering if there is a way to write a calculation that counts occurrences without the relationship. Maybe a custom function?

Posted

Yes you can use Agnes' Custom List Function http://www.briandunning.com/cf/868

CustomList ( 1 ; Count( keyfield_related_table) ; "ValueCount( GetNthRecord ( status ; [n] ) = "active") )" )

You could accomplish getting totals with out using a relationship but you would have to script a process switching layouts getting found sets or show all record etc. There are several methods that could be employed.

Posted

ValueCount( FilterValues( List( Relation::Field); yourTestValue))

This topic is 5945 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.