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.

Join Table Multi Join Join Join lets play twister reltationship

Featured Replies

Not sure what to call this type of relationship but I have companies that are affiliated with one another an they want to view all affiliated companies from any of the affiliated companies.

So If:

Company 1 is affiliated with Company 2

Company 1 is affiliated with Company 3

Company 3 is affiliated with Company 4

Company 4 is affiliated with Company 5

Then they should all be considered affiliated with one another and you should be able to see a list of companies 1 - 5 from any of the individual company records.

I have sorted some of this out using a join table that joins to its self multiple times but there will always be a limit to how distant the relationship can be and still connect the affiliated companies.

I have attached an example of the multiple joins. There are two layouts, one for companies and one for joins so you can see where the related companies link or do not link. Inserting more joins in the chain will increase the level of connectivity but I think there is always a limit.

Wondering if anyone has a simple solution to show all the interconnected relationships other than just putting together a number of joins?

Test_Self_Join_Many_2_Many.fp7.zip

What exactly does "affiliation" mean? Is it possible for three companies to be affiliated with each other, so that A is affiliated with B, B with C and C with A?

If so, then I believe the problem is not how to extend the pattern, but rather how to limit it - otherwise you will end up in an exponentially growing loop.

  • Author

And that is the problem as they have a very broad definition of "affiliation" so it could mean that they are all members of a parent company or that they have the same owner or literally any other reason that they feel that they should be considered affiliated with one another.

I was hoping there was some other approach than multiple joins but I think I will put a few in and ask that they try to identify master companies and associate the others to that rather than trying to trace through all of the possible paths.

Thanks for the reply.

What exactly does "affiliation" mean? Is it possible for three companies to be affiliated with each other, so that A is affiliated with B, B with C and C with A?

If so, then I believe the problem is not how to extend the pattern, but rather how to limit it - otherwise you will end up in an exponentially growing loop.

Well, it's possible to do it with only one level of relationships, but it needs to be scripted: basically, you would GTRR [Match found set] in a loop, until the found set stops increasing; then you will have a found set of an entire interconnected group.

Another approach. Builds lists of related keys. Not quite the full answer you're looking for but may give you ideas.

Test_Self_Join_Many_2_ManyBFR.fp7.zip

Ahm...

FailTest.fp7.zip

Edited by Guest

Ahm...

?

I am not sure by what logic it's supposed to work, but in any case it doesn't.

FailAgain.zip

As I mentioned VERY clearly, this is to give you ideas. Or the original questioner ideas.

It does have a limited hierarchy depth for single continuous hierarchies. (1:2; 2:3; 3:4; 4:5 etc). However even a single cross record results in an all match. If you want deeper hierarchies you can extend the calculation technique if you choose to go this route.

It is an available technique with a simple graph and no scripting. There are other techniques and the person posing the question will have to figure out what methods and what limitations are acceptable.

Surely you can't be serious about having difficulty figuring this out.

FailNot.fp7.zip

Edited by Guest

Surely you can't be serious about having difficulty figuring this out.

Why not? You posted a file that shows a method. The method is not explained, and it doesn't work in all circumstances. No limitations are stated. Am I supposed to spend a day trying to figure out what your idea was, when I already know it doesn't work?

If you want deeper hierarchies you can extend the calculation technique if you choose to go this route.

I am not at all convinced that is the case. I'd suggest you do some reading on graph theory and perhaps the traveling salesman problem, which although more difficult than the current problem, gives a good idea of what is involved here.

Why not? You posted a file that shows a method. The method is not explained, and it doesn't work in all circumstances. No limitations are stated. Am I supposed to spend a day trying to figure out what your idea was, when I already know it doesn't work?

Untrue. As I have now repeated several times.

Yes, as a matter of fact you ARE supposed to spend your time figuring it out. Again - you can't be serious. It won't take you a day. Figuring out what you understand, what you don't understand, and what you understand but want to waste your time arguing with me about just is not where I'm willing to spend my time.

If you were serious you'd describe the problem. WHAT doesn't work? You clearly put effort into creating a very particular hierarchy that would illustrate the limits of the demonstration of the technique, so your claim that you can't figure this out is disingenuous.

You're welcome to post compliments:

http://fmforums.com/forum/showpost.php?post/367793/

I am not at all convinced that is the case. I'd suggest you do some reading on graph theory and perhaps the traveling salesman problem, which although more difficult than the current problem, gives a good idea of what is involved here.

Then put your effort into establishing a proof of your statement that meets your expectations.

Are you calling me a liar?

I am not at all convinced that is the case. I'd suggest you do some reading on graph theory and perhaps the traveling salesman problem, which although more difficult than the current problem, gives a good idea of what is involved here.

Calc extended, hierarchy depth extended.

QED

FailNot.fp7.zip

  • 2 weeks later...

I am not at all convinced that is the case. I'd suggest you do some reading on graph theory and perhaps the traveling salesman problem, which although more difficult than the current problem, gives a good idea of what is involved here.

Bees do it better: solving the traveling salesman problem:

http://www.qmul.ac.uk/media/news/items/se/38864.html

So we need to use b-trees then?

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.