6 Replies Latest reply: Sep 7, 2015 6:40 AM by Christian Wylezol RSS

    Hierarchy Bottom Level Depth

    Christian Wylezol

      Hi,

       

      hopefully someone of you can help me :-)

      I successfully created a hierarchy. Now I Need to know in a field the entries of the bottomline (Last Node used).

      (See Photo: A field only containing the entries with numbers)

      Problem: Sometimes it is Depths 2, sometimes Depths 3

       

      How can I make this work.

      I searched the QlikCommunity but couldnt find anything similar.

       

      Thanks in advance.

      Chris

        • Re: Hierarchy Bottom Level Depth
          Tresesco B

          You probably have a string field with separator behind this, something like this:

          Total Function Total Function/01 Sales....

          Total Function Total Function/ProdMaint..../02 Production.

           

          For such strings you can check for the last string separated by the delimiter, using : SubField(FieldValue, '/', -1) . This will give you a string wich is last node.

            • Re: Hierarchy Bottom Level Depth
              Christian Wylezol

              Hi tresesco,

               

              unfortunately I dont get it to work. would you please help me?

              Where should this be put in (I would call it D_CODE)?

              Here my Code:

              //Functions als Hierarchie laden
              CODE_D:
              replace Hierarchy (D_CodeID, D_ParentID, D_NodeName, D_ParentName, D_Pathsource, D_PATH, '/', Depth)
              replace
              LOAD D_CodeID,
              D_ParentID,
              D_NodeName,
              D_CodeID&' '&D_NodeName as D_Pathsource
              ,
              SubField( D_PATH, '/', -1) as D_CODE
              FROM
              [F:\Projekt OptiVision_IFS\C_SETUP Solution IFS Dettingen\Qlikview Simulation\Struktur IFS_NeueFire.xlsx]
              (
              ooxml, embedded labels, table is _CODE_D);


              //Gruppierung der Hierarchie mit einbinden
              AncestorsD:
              HierarchyBelongsto (D_CodeID, D_ParentID, D_Node, D_TreeID, D_Tree, D_DepthDiff)
              LOAD D_CodeID,
              D_ParentID,
              D_NodeName as D_Node
              Resident CODE_D;

               

              Chris