Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

calculating from related records

Featured Replies

New member, possibly naive question:

I have a families database for a small school. 2 tables: families, which contains parent contact information, and children, which contains child information, related to families by a unique index field (FamIndex.

Children has a field (for each child, obviosuly) called EnrollStatus which can have values 'inquiry', 'accepted', 'enrolled', 'alumni', 'declined,'etc. I would like a calculated field in parents which takes the values:

enrolled, if any of the associated children are enrolled,

alumni, if any of the children are alumni,

prospective, if any are inquiry or accepted,

declined, if none of the above are true and any children are declined.

I am using List and PatternCOunt like this:

Case(

PatternCount ( List ( children::EnrolStatusChild ); "enrolled")>0; "enrolled"; PatternCount(List(children::EnrolStatusChild ); "alumni")>0; "alumni";

(PatternCount ( List ( children::EnrolStatusChild ); "inquiry")>0

or

PatternCount ( List ( children::EnrolStatusChild ); "accepted")>0); "prospective";

PatternCount ( List ( children::EnrolStatusChild ); "declined")>0; "declined";

"other"

)

so I guess I have it figured out but it seems kind of inelegant.

Any thoughts?

Thanks,

Dave

How about:


Let ( childstat = List ( children::EnrolStatusChild );

      Case ( not IsEmpty ( FilterValues ( childstat; "enrolled" ) ); "enrolled"; 

             not IsEmpty ( FilterValues ( childstat; "alumni" ) ); "alumni";

             not IsEmpty ( FilterValues ( childstat; "accepted" ) ); "prospective";

             not IsEmpty ( FilterValues ( childstat; "declined" ) ); "declined";

             "other"

           )  

    )

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.