Nigel Strudwick Posted July 6, 2009 Posted July 6, 2009 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!
bcooney Posted July 6, 2009 Posted July 6, 2009 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.
comment Posted July 6, 2009 Posted July 6, 2009 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. not IsEmpty ( FilterValues ( "King¶Queen¶Prince¶Princess" ; List ( Titles::Title ) ) ) will return true if the person is a royalty.
Nigel Strudwick Posted July 6, 2009 Author Posted July 6, 2009 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!
Recommended Posts
This topic is 5966 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 accountSign in
Already have an account? Sign in here.
Sign In Now