Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
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