Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Hierarchy

Hi Friends,

     Please anyone say, the difference between Hierarchy and Hierarchy belongsto.....

2 Replies
Anil_Babu_Samineni

Hope helps You


Theory:

Hierarchy is used to create an Expanded Nodes table, where each level in the hierarchy is stored in a seperate field.  This makes it ideal for use in a listbox treeview, or a pivottable.

Hierarchy BelongsTo is used to create an Ancestors table, which contains one record for every child-ancestor relation found in the data.  This makes it better suited for allowing selection of entire trees of data.

Sample Example:

ORGANOGRAMA:

Hierarchy(COD_DEPARTAMENT, COD_DEPARTAMENT_UP,SIG_DEPARTAMENT,SIG_DEPARTAMENT_UP,SIG_DEPARTAMENT,PATH,'/','LEVEL')

LOAD COD_DEPARTAMENT, COD_DEPARTAMENT_UP, SIG_DEPARTAMENT

INLINE [

    COD_DEPARTAMENT, COD_DEPARTAMENT_UP, SIG_DEPARTAMENT

    1, , COMPANY 1

    2,1, DEPARTAMENT 1

    3,1, DEPARTAMENT 2

    4,1, DEPARTAMENT 3

    5,1, DEPARTAMENT

    6, , COMPANY 2

    7,6, DEPARTAMENT 1

    8,6, DEPARTAMENT 2

    9,6, DEPARTAMENT 3

    10,6, DEPARTAMENT 4

];

HIERARQUIA:

HierarchyBelongsto (COD_DEPARTAMENT, COD_DEPARTAMENT_UP, SIG_DEPARTAMENT, CODIGO, UNIDADE, HLEVEL)

LOAD

COD_UNIDADE,

COD_UNIDADE_PAI,

SIG_UNIDADE

Resident ORGANOGRAMA;

RealTime:

Hierarchy and Hierarchy Belongs to

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thank u very much