Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Hierarchy Question

Hello all,

I have a Customer table and from this table I would like to create a hierarchy like

CustomerClass >> Region>>Area >> Branch.

I have attached sample data.

Thanks

3 Replies
Anil_Babu_Samineni

Check accordingly

Capture.PNG

ORGANIZATION:

LOAD * INLINE [

    CustomerClass, Region, Area

    Distributors, West, NBL Central

    Distributors, Kampala, NBL West

    Distributors, West

    Distributors, West, NBL Central

    Distributors, West, NBL West

    Export, West, NBL West

    Export, Kampala, NBL West

    Export, Kampala, NBL Central

];

TREE_VIEW:

LOAD Distinct CustomerClass as VALUE, CustomerClass & '-ROLE' as NODE_ID, Region & '-REPORTINGMANAGER' as PARENT_NODE_ID resident ORGANIZATION;

LOAD Distinct Region as VALUE,Region & '-REPORTINGMANAGER' as NODE_ID, Area & '-LEVELOFBUSINESSHEAD' as PARENT_NODE_ID resident ORGANIZATION;

LOAD Distinct Area as VALUE,Area & '-LEVELOFBUSINESSHEAD' as NODE_ID,  Area & '-LEVELOFBUSINESSHEAD' as PARENT_NODE_ID resident ORGANIZATION;

HIERARCHY_TABLE:

Hierarchy(NODE_ID_H,PARENT_NODE_ID_H, ID, PARENT_NAME, NAME, Organization_Structure) load

NODE_ID,

NODE_ID as NODE_ID_H,

PARENT_NODE_ID as PARENT_NODE_ID_H,

VALUE as ID,

VALUE as NAME

resident TREE_VIEW;

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
Not applicable
Author

Thanks Anil for your response, but I also need to find out about section access?

Anil_Babu_Samineni

You may search on google. You will get number of threads and Docs related one. Start writing or copy paste same code on your hierarchy then look on it

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