3 Replies Latest reply: Jan 19, 2016 11:03 AM by Marcus Sommer RSS

    expanded nodes table to hierachy

      Hi everybody,


      I hope someone could help me with my issue.  have an SQL-Database with Elements. This table already include the nodes (add1 to add6) of every element. Now I want to create the Hierarchy but I dont get the order I Need (I think, the depth is missing).

      (The Hierarchy should present a fix structure, meaning add1 as parent from add2 is at bottom, add2 as parent from add3 directly above add1 and so on))


      One Thing is important. The fields from the SQL-Database must be used. It is not possible to exclude this into an excelfile due to redundancy issues (we unfortunately had that in the past)


      Example of Solution (Structured View):


      This is the part of the Script that I already have. It is creating the reporting lines but the order is not in there. Everything is mixed up.

      Let vHierarchyDefinition = 'Adr1,Adr2,Adr3,Adr4,Adr5,Adr6';
      Let vNumberOfLevels  = Len(KeepChar(vHierarchyDefinition,',')) + 1 ;

      For vAncestorLevel = 1 to vNumberOfLevels
      Let vAncestor = Subfield(vHierarchyDefinition,',',vAncestorLevel);

      Load distinct
      /*Upper*/([$(vAncestor)]) as ReportingLine, //Upper converts into CAPITAL LETTERS
      Resident [oas_elmaddrlist_El1];
      Next vAncestorLevel 
      store Elm1AddressTree into $(DirDataQVD)Elm1AddressTree.qvd;
      DROP TABLE Elm1AddressTree; //Element1-Adressen
      DROP TABLE oas_elmaddrlist_El1; //Element1-Adressen

      Does somebody of you have an idea and could help me with this?


      Very much thanks in advance.