July 11, 201213 yr 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.
July 13, 201213 yr Perhaps this can get you started. http://jonathanstark.com/archive/recursive-data-structures.php
July 15, 201213 yr Author 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...
July 15, 201213 yr 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.
Create an account or sign in to comment