July 6, 200916 yr 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!
July 6, 200916 yr 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.
July 6, 200916 yr 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.
July 6, 200916 yr Author 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!
Create an account or sign in to comment