Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
hemanthaanichet
Creator III
Creator III

How to create Hierarchy ?

Hi All,

I would like to create a hierarchy for the below scenario 

Top level is Country Head like below

Country Head

       ->State Head

                  ->City Head

                            ->Area Head

Country HeadState HeadCity HeadArea Head
MarioMarioMarioMario
MarioSaraSaraSara
MarioSaraPeirisPeiris
MarioSaraPeirisDumi
MarioSaraPeirisRashm
MarioSaraPeirisRanda
MarioSauraSauraSaura
MarioSauraChaimChaim
MarioSauraChaimNira
MarioSauraChaimOvitiga
MarioSauraChaimSani
Regards
Hemanth
10 Replies
techvarun
Specialist II
Specialist II

replace the TREE_VIEW Table code like below to get the Hierarchy as you expected.

TREE_VIEW:

LOAD Distinct StateHead as VALUE, StateHead & '-StateHead' as NODE_ID , CountryHead & '-CountryHead' as PARENT_NODE_ID resident ORGANIZATION;

LOAD Distinct Cityhead as VALUE,Cityhead & '-Cityhead' as NODE_ID, StateHead & '-StateHead' as PARENT_NODE_ID resident ORGANIZATION;

LOAD Distinct Areahead as VALUE,Areahead & '-Areahead' as NODE_ID,  Cityhead & '-Cityhead' as PARENT_NODE_ID resident ORGANIZATION;

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

sample.PNG