Jump 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.

many to many with restricted criteria

Featured Replies

Somehow I can't quite wrap my head around this one. I have People affiliated with Organizations via a join table for a many to many relationship. I have a field "status" that is calculated by criteria as follows:

Case (

not IsEmpty (date_deceased); "Deceased";

not IsEmpty (transferred_out_date); "Transferred";

not IsEmpty (date_retired); "Retired";

not IsEmpty (PEOPLE_j_organizations::)_kp_organization_join) and IsEmpty (PEOPLE_j_organizations::date_end); "Active";

"Inactive"

)

I want status to read "active" if ANY of the joined affiliations does not have an end date. How do I do this, or is there a better way to make this happen?

The trimmings needs to go to the join table records but the info reside in one of the other tables?

A way to do it is auto ID each of the join table records, and then make the calc in the jointable instead. The result of the calc will in case the condtion is met the records ID is copied via a calc field, which now is made into a primary key from the join table ... but connected to a selfjoin of the jointable, this will make the filtering, but where you in the old portal showed all, would a layout change pointing at the selfjoined a step further away...

Perhaps it makes more sense to see a template?

--sd

dodah.zip

  • Author

Not sure what you mean by trimmings, but yes, deaceased_date etc are in People table (as is status), not in join table. But your comment got me thinking about having something in the join table, so I made a calc field (count_active_affiliations) with formula "Case ( IsEmpty (end_date); 1; 0)" to return 1 for every open affiliation and 0 for closed. Then I changed the status formula to:

Case (

not IsEmpty (date_deceased); "Deceased";

not IsEmpty (transferred_out_date); "Transferred";

not IsEmpty (date_retired); "Retired";

Sum (PEOPLE_j_organizations::)_c_affiliations_active) > 0; "Active";

"Inactive"

)

Seems to work. Side benefit... can count open (& closed) affiliations. So thanks for the inspiration!

Edited by Guest

How about:

Count ( Affiliations::PersonID ) > Count ( Affiliations::EndDate )

Create an account or sign in to comment

Important Information

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

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.