Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to create hierarchy levels in qlikview

Hi All,

Please any help in creating hierarchy levels in qlikview will be appreciated:

Below is code in oracle, where LEVEL field is created, which I want to implement in qlikview:

SELECT employee_id, last_name, manager_id, LEVEL

   FROM employees

START WITH manager_id in ('100')

   CONNECT BY PRIOR employee_id = manager_id;

EMPLOYEE_ID LAST_NAME      MANAGER_ID      LEVEL

----------- ------------------------- ---------- ----------

        101 Jane                                 100          1

        108 Greenberg                        101          2

        109 Faviet                               108          3

        110 Chen                                108          3

        111 Sciarra                             108          3

        112 Urman                              108          3

        113 Popp                                 108          3

Thanks in advance:)

Regards

Neetha

16 Replies
luciancotea
Specialist
Specialist

Then it's a problem with your SQL or connection. It's not a QLikView issue.

Anonymous
Not applicable
Author

I am getting this error when I use sqlquery and hierarchy prefix together.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear Neetha,

The Hierarchy function is a QlikView Function and not a sql function.

You can not use it with your sql query.

You will have to fetch below data using select query and then you can use the hierarchy function.

Select EmpID,ManagerId, EmpName From XYZ;

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
luciancotea
Specialist
Specialist

It should work, according to Help:

The hierarchy prefix is used to transform a hierarchy table to a table that is useful in a QlikView data model.

It can be put in front of a Load or a Select statement and will use the result of the loading statement as input for a table transformation.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Thanks Lucian..

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Hi Lucian/Kaushik,

Thanks for both solutions, which are working.

Regards

Neetha

dineshraj
Partner - Creator
Partner - Creator

Hi luciancotea,

Thanks for your solutions.This is Very helpful to me.