Unlimited Infinite Hierarchies

No preview video available.

You've always been able to implement Hierarchies within FileMaker Pro - even back in version 3 - at least from a data standpoint. You can easily use two fields to manage a Parent to Child relationship. However, the biggest problem of understanding, implementing and using hierarchies rears its ugly head when it comes to managing and allowing users to interact with them.

Along comes FileMaker 10 (which the referenced file requires) and you're now able to more easily manage an unlimited number of hierarchies based on any tables or records in your solution and each hierarchy can have an infinite number of rows. There are no limitations based on table occurrences when you understand the data structure of how it all works.

The remaining problems to solve are related to user interaction with the Hierarchy and maintaining state of collapsed and expanded rows.

If you've always wanted a deep understanding of how to use these "folder trees" (know as posets in Hierarchy mathematics), you'll be hard pressed to find better information about getting them into FileMaker Pro!

AttachmentSize
UnlimitedInfiniteHierarchies10.zip240.38 KB

Comments

Matt, I've been wanting to do unlimited hierarchies for a while, and was tearing out my hair over various roadblocks. So I'm really glad to to know about the method you show in these videos.

I've been working for a while on a different method, and I wonder what you think about how the two compare. I've been working on storing the hierarchy for each list in a text field as nested xml data. In other words, the data would look something like this:


<record id="1" expanded="1">
<record id="2" expanded="0">
<record id="3"></record>
</record>
<record id="4"></record>
</record>

A custom function spits out a list of id numbers to a calculation field, that are then displayed in a portal. Of course, this can't display the same record more than once in the portal.

Unfortunately, this has involved laboriously writing many custom functions to parse the xml, calculate ancestry, level, etc. Neither is it as native an approach to Filemaker as yours is. However, it makes issues like moving and sequencing records less of a problem. I don't know yet how the performance will be, but by my preliminary tests, it might not be great.

Anyway, do you see other advantages / disadvantages to the two methods?

Thanks,
Nathan

Matt,

This technique is really great. A little too hard to implement, specially for newcomers in FM like me. Anyway, I think we may have a situation you haven't consider (or perhaps I didn't understand it). Please, correct me If I'm wrong. Here it comes:

In your script "Repair Sequence", sub-item: "Sort initial sequence by branch level and adjust leaves which are not in order",
on the third script step: "Replace field contents", specify target field, you have the following calculated value:

If (
Me::Sequence - Parent::Sequence > 1 // How far away am I from my parent
and Me::Level > 1 // As long as I'm not at level 1
and Count ( Parent Children::Sequence ) = 1; // And I don't have any siblings
Parent::Sequence + ,0001;
Me::Sequence
)

Ok. But I do have siblings. Lots of them, actually. I'm working on some kind of BOM (Bill of Materials). As a matter of fact, I took the liberty to modify your technique raw data file, in MyGroup (RecordID=1), and changed the Parent ID of "Amanda" (ID 18). Instead of having "Louise" (ID 12) as her "Parent", I changed to "Ana" (ID 11), her "new Parent". By doing so, now "Ana" (ID 11) has two children, "Amanda" (ID 18) and "Mary" (ID 3), therefore, we now have "siblings".

Happens that when you click on "Ana", on the Groups Layout, her two children "Amanda" and "Mary" appear below "SAMANTHA" (ID 22)!!!

I don't think this is what you intended to do. May be we need another "elseif" that states this condition ( I HAVE SIBLINGS ), and in this case, I really don't have any clue how to accomplish it.

So, please, tell me what I'm doing wrong, so I can have these "Children" below its "Parents".

Thank you very much for your time, and "happy filemaking".

Alvaro Guedes
Civil Engineer
São Paulo - Brasil

As mention on your videos, did you complete the template with ability to add and delete from the hierarchies.

Recently found this video, I went through the library and could not find the first two videos on hierarchies mentioned in this video. Can you point me to those videos?

Hi Mat,

great work. For the unlimited infinite hierarchies I would be interested in the Videos 1 and 2 just to understand how you got there.

Regards

Ernst