Jump to content

Self-Refering Calculated Relationship


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

Recommended Posts

Posted

I have a table with a list of cached incoming contacts, all in various user accounts.

I want to make a relationship that refers the table to itself to get a portal list of contacts without assigned unique FM ID's like so:

6835690335_f449dcbfbd_b.jpg

Of course, this isn't possible, but it would be nice.

Yes, this could be done using a find, but I'm trying to save some steps if possible. From there, I'd add a calculated foundcount() field based on the related records to decide which options to show or hide.

Ideas?

Posted

Could you rephrase your question? Perhaps focus more on what you want to achieve, and less on why it's not possible?

comment - Thank you for your reply. You're right. The question is about a relationship, but the end goal is presentation layer information based on a calculation and a relationship.

While in the layout for table 'Outlook Contacts Cache', I want a calculation field to give me a record count of the contacts that exist without an ID. The expression 'Count ()' will not accept an expression in place of a field thus: 'Count ( IsEmpty( Outlook Contacts Cache::ID) )'. If I had a self-referring relationship that could include calculations, like the above, I could use 'Count (OL New Contacts::ID)' in the calc field. I could script this into a global field, but I can better base button availability and conditional formatting on a calc field. If there are new contacts, I can 'light up' the 'View New' button so that users can easily see there are new contacts to import into filemaker from the table 'Outlook Contacts Cache'.

Posted

I want a calculation field to give me a record count of the contacts that exist without an ID.

Assuming you want to count among all records in the table, not just the current found set: define a self-join relationship using the x relational operator. You can use any field/s as matchfields, e.g.:

Outlook Contacts Cache::ID x Outlook Contacts Cache 2::ID

With this in place, a calculation field (result is Number) =

 Get ( TotalRecordCount ) - Count ( Outlook Contacts Cache 2::ID )

should return the required number.

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