Jump to content

Flag In Main When Condition Met In Related


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

Recommended Posts

Have 2 tables, Main and Component with records related via serial number.

I need to find a way to raise a flag in Main when all related records in Component have the same condition met.

i.e. - when the "completed" field for all 3 components related to the master say "yes" a field in master automatically says "yes" too.

Thanks in advance.

Link to comment
Share on other sites

I usually set up boolean fields, i.e. True/False, Yes/No, Flagged/Unflagged as number fields that will only ever contain either 1 or 0, and format the field appropriately.

If you follow that standard, then in your Main file you can define a new calculation field:

Valid_Flag (unstored, number) = Sum(Related_Components::Flag) = 3

will return 1 if all 3 components are flagged.

If each record in the main file has a different number of related components then

Valid_Flag (unstored, number) = Sum(Related_Components::Flag) = Count(Related_Components::Flag)

should work.

Link to comment
Share on other sites

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