Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

Multi-level tree structure in one table


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

Recommended Posts

Posted

I want to build a multi-level tree structure with a single table, where every child has just one parent.

The table is fairly simple and I call it 'nodes', it has the following fields:

IDnode

IDparent

nodeName

path (a calculation that should show the whole path from the tree root node)

Root nodes will point to an IDparent valued 0.

I create a second instance of this table called 'parents' and a relationship between both tables:

nodes::IDparent = parents::IDnode

Then I write the following calculation in the path field:

If (IDparent=0; node; parents::path & ">" & nodeName)

I have been able to do this with previous versions of FMP but now, under FMPA 11 I cannot.

Is something wrong with this approach? is it possible that it worked before 11? how can I get it right (without lookup fields and scripting)

The answers I found so far are very complex and I am sure I was able to make it work before...

Thank you in advance.

Posted

Perhaps this can get you started.

http://jonathanstark.com/archive/recursive-data-structures.php

Posted

Thank you very much for the in-depth article you point to, it's very interesting, however the problem I find is with displaying a 'path', as if I would like to display all the names between employee x and the CEO.

The question is how can I build a calculation able to display the whole path of names between any employee and the CEO?

Any additional help will be welcome...

Posted

The path would consist of the individual's path to the next higher level (if there is one), plus that one's path (ditto); sort of poor man's recursion.

post-80889-0-36012600-1342353415_thumb.p

Posted

thank you eos, this is what I meant, now it works

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