Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
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
Specialist

Hi,

1 Option:

=[Country Head] & '/' & [State Head] & '/' &  [City Head] & '/' &  [Area Head]

hieroct.png

Creator III
Creator III

I need this in edit script... Using hierarchy function kind off....

Contributor II
Contributor II

Hi.

Change the table in the script to this:

TreeElements:

LOAD * INLINE[

Element     Parent

Mario          -

Sara           Mario

Peiris          Sara 

Dumi          Peiris

Rashm        Peiris    

Randa         Peiris

Saura          Mario

Chaim        Saura

Nira           Chaim

Otiviga       Chaim

Sani          Chaim

Then apply the function Hierachy:

Hierarchy(Element, Parent, , , 'TreeElement')

LOAD

     Element,

     Parent

Resident TreeElements;

Then display the TreeElement field as listbox, selecting the "Show as Tree view", as in example above.

Creator III
Creator III

What is your original data looks like ?

Specialist II
Specialist II

Specialist II
Specialist II

Check the attached

Creator III
Creator III

The data has to be look like below:

->Mario

    ->Sara

         ->Peiris

                 ->Dumi

                 ->Rashm

                 ->Randa

   ->Saura

          ->Chaim

                 ->Nira

                 ->Ovitiga

                  ->Sani

Creator III
Creator III

can you attach a Excel file which contains your sample data ? just want to make sure the data format you have

Creator III
Creator III

Dave sample file for you