4 Replies Latest reply: Dec 30, 2010 7:28 AM by prabhu RSS

    Hierarchy Problems

    MARCO HADIYANTO

      Dear all,

      I have problems with hierarchy, when i want to choose just africa not parts of africa why the cursor can't static at africa?

       

      here is my code

       



      T1:
      LOAD * INLINE [
      ID, Name, ParentID, ParentName
      1, Perth, 1, Australia
      2, London, 2, Europe
      3, UK, 2, Europe
      4, British, 2, Europe
      5, France, 2, Europe
      6, Italy, 2, Europe
      7, Rome, 6, Italy
      8, Africa, 8, Africa
      9, Nigeria, 8, Africa
      10, South Africa, 8, Africa
      ];

      LOAD *,
      ParentName &'+'& Name as Path
      Resident T1;DROP Table T1;


       

      need advice,

       

      thanks,

      Marco

        • Hierarchy Problems
          Jean-Jacques Jesua

          Hi

          Not sure to understand your problem.

          Have a look to the app. I can select use the hierarchy.

          JJ

            • Hierarchy Problems
              MARCO HADIYANTO

              hi, thanks for reply

              what i mean is, i want to make one list hierarchy.

              but the root can't be choose.

               

              Marco

                • Hierarchy Problems

                  Hi Marco,

                  Copy this code and reload , you will get the result.

                   

                  T1:
                  LOAD * INLINE [
                  ID, Name, ParentID, ParentName
                  1, Perth, 1, Australia
                  2, London, 2, Europe
                  3, UK, 2, Europe
                  4, British, 2, Europe
                  5, France, 2, Europe
                  6, Italy, 2, Europe
                  7, Rome, 6, Italy
                  8, Africa, 8, Africa
                  9, Nigeria, 8, Africa
                  10, South Africa, 8, Africa
                  ];



                  T2:
                  Concatenate
                  Load
                  ID,
                  ParentName as Name,
                  ParentID
                  Resident T1;



                  hierarchy(ID,ParentNode,Name,TEST,Name,PATH)

                  Load
                  ID,
                  ParentID as ParentNode,
                  Name
                  Resident T1;

                  drop table T1;

                   

                  Regards,

                  Prabhu

              • Hierarchy Problems

                Hi Marco,

                reload this code, you will get the correct result

                T1:
                LOAD * INLINE [
                ID, Name, ParentID, ParentName
                1, Perth, 1, Australia
                2, London, 2, Europe
                3, UK, 2, Europe
                4, British, 2, Europe
                5, France, 2, Europe
                6, Italy, 2, Europe
                7, Rome, 6, Italy
                8, Africa, 8, Africa
                9, Nigeria, 8, Africa
                10, South Africa, 8, Africa
                ];


                AdjacentNodesTable:
                LOAD null() AS Parent, ParentName AS NodeID, ParentName AS NodeName,ID RESIDENT T1;
                LOAD ParentName AS Parent, Name AS NodeID, Name AS NodeName,ID RESIDENT T1;
                LOAD Name AS Parent,ID RESIDENT T1;

                hierarchy(NodeID,ParentN,NODES,TEST,NODES,Path)
                Load
                NodeID,
                Parent as ParentN,
                NodeName as NODES

                Resident AdjacentNodesTable;

                DROP FIELD NodeName FROM AdjacentNodesTable;

                 

                Enable the option show as treeview in Properties list box.

                Regards,

                Prabhu