Jump to content

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

Recommended Posts

Posted

Greetings. I have two linked databases, one of persons and another of their titles, linked on an ID field; it's a one-to-many relationship. I need to be able to calculate whether each selected person has a variety of titles, which means checking through each element of the set of related records and setting a flag for that person.

Years ago I did this in Algol with this sort of pseudo-code:

For each person

For each related record

If the title is one of the ones needed, set a flag in the person DBF

End loop of related records

End loop of persons

What I can't figure out is how I make the if test on just the records related to the person.

I am probably approaching it from the wrong way in FMP...

I hope this is clear. Thanks!

Posted

Reading through your post, it seems you are trying to find people of a certain title or titles.

You could just find in the titles table and go to related records match found set. That'll give you all the people with that title.

There are other techniques, but is not clear exactly what you are trying to do.

Posted

If the title is one of the ones needed, set a flag in the person

This could be calculated from the people table, e.g.:D

not IsEmpty ( FilterValues ( "King¶Queen¶Prince¶Princess" ; List ( Titles::Title ) ) )

will return true if the person is a royalty.

Posted

Thank you both for your answers. I think I have it figured out.

"List" is what I was looking for--I'd missed that function completely, but it seems to do what I wanted, by allowing me to process the related records as one string.

I'm trying to produce a complex presence-absence chart of persons vs certain titles, and I believe I have the key now.

Thank you again!

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