I want to use Hierarchy & HierarchyBelongsTo together in my solution. and in qlikview layout, on clicking the tree layout , I should be able to select and see all the hierarchy in the table box. How can I achieve that..I have written script like below-
TreeLayout:
QUALIFY *;
UNQUALIFY '*Key';
LOAD
ID AS mainKey,
code_name AS Name,
PARENTID AS ParentID,
DESCRIPTION AS Description,
SQL SELECT *
FROM dim_table;
UNQUALIFY *;
TreeLayoutView:
Hierarchy (mainKey, ParentID, Description, PrtName, Description, Path, '/', Depth)
LOAD
mainKey,
TreeLayout.ParentID AS ParentID,
TreeLayout.Description AS Description
RESIDENT TreeLayout;
TreeLayoutView2:
HierarchyBelongsTo (mainKey, ParentID, Description, [Ancestor ID], AncestorName, Depth)
LOAD
mainKey,
TreeLayout.ParentID AS ParentID,
TreeLayout.Description AS Description
RESIDENT TreeLayout;
View3:
LOAD [Ancestor ID] as mainKey,
mainKey as mainKey1
RESIDENT TreeLayoutView2;
//DROP Field Description FROM TreeLayoutView2;
DROP Table TreeLayoutView2;