2 Replies Latest reply on Apr 16, 2018 3:22 PM by Peter Fakan

    Organizaton hierarchy with MPTT

    Steeve Werren

      Hi the community!

       

      I have a DB with a table for Organization information like this:

       

      I have a parent-child relationship on this table.

       

      I implemented the MPTT algorithm (Storing Hierarchical Data in a Database, Part 2 — SitePoint) so it's because of that that I have left, right and depth column.

       

      I tried to create a view/dashboard with the following things:

      • Have a filter Org_name parent
      • Show all the organization and sub-organization into my Org_Name parent (according to the filter)

       

      I know how a can do the trick in ASP.NET (with Entity Framework) to have the complet list of all org and sub-org into my selected parent org. The trick in ASP.NET is like this:

       

      var org_tree_query = db.T_Organisation.Where(node => node.Org_Lft >= parent.Org_Lft && node.Org_Lft <= parent.Org_Rgt)
                          .OrderBy(node => node.Org_Lft);
      

       

      How I can reach my goal with Tableau?

       

      Thank you in advance!

       

      Steeve