7 Replies Latest reply: Dec 27, 2013 7:41 PM by Ola Car RSS

    Using hierarchy with qualify

    Wei Wang

      I am getting errors when trying to use hierarchy. The following is a simple example that illustrates what I am trying to do

       

      If I have the following in my script, everything runs just fine.

       

      MyTable:

      Hierarchy(ID, ParentID, Name)

      LOAD ID, ParentID, Name

      INLINE

      [ ID, ParentID, Name

      1, 0, root1

      2, 0, root2

      3, 1, 1-1

      4, 3, 1-1-1

      5, 2, 2-1

      6, 3, 1-1-2];

       

      However, if I add the qualify statement at the top, reload errors out. (Error: HIERARCHY parameter NodeName (="Name") is not a valid field)

       

      QUALIFY *;

       

      MyTable:

      Hierarchy(ID, ParentID, Name)

      LOAD ID, ParentID, Name

      INLINE

      [ ID, ParentID, Name

      1, 0, root1

      2, 0, root2

      3, 1, 1-1

      4, 3, 1-1-1

      5, 2, 2-1

      6, 3, 1-1-2];

       

      I tried adding table name as the prefix to the parameters, but that didn't help.

       

      Any explanation would be appreciated.

       

      Thanks,

      Wei