Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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