Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can anyone please tell me how to use the hierarchy function in qlikview 11.0 and what is the use of this function? Also, If someone can paste the exact code with syntax with the explanation then it will be really helpful.

Can anyone please tell me how to use the hierarchy function in qlikview 11.0 and what is the use of this function? Also, If someone can paste the exact code with syntax with the explanation then it will be really helpful.

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

I would display this as two simple List boxes, one for Gender and one for Age. This way you will allow the user to make any selection representing intersections between selections in the two fields, e.g.: Gender=female AND (Age=10-20 OR Age=20-30).

If you squeeze both fields into one tree view (which most likely is possible with some script work) then you would not be able to make such selections.

HIC

View solution in original post

11 Replies
hic
Former Employee
Former Employee

The Hierarchy prefix unpacks an Adjacent Nodes table, i.e. a table that has one record per node and each node has a reference to its parent. The output of the Hierarchy prefix is an Expanded Nodes table, i.e. a table where each level has its own column.

Se further in the example.

HIC

Not applicable
Author

Thanx Henric for the reply. But the problem is that if i open Winedistricts.qvw, then i will have to recover it because i have a qlikview personal edition and then i will not be able to open my orignal file. So, i will be very grateful to you if you can just copy and paste the heirarchy function from this file in your reply.

hic
Former Employee
Former Employee

Have you tried to open it? It should contain an embedded license, so you shouldn't need to use any recover attempt.

HIC

Not applicable
Author

okkk, you mean that if i have to create a heirarchy in my report then i will have to create an external file apart from my database file in which the heirarchy is defined in the way you have defined it in winedistrict.xls??

hic
Former Employee
Former Employee

No, you should not have to have any external files if your DB contains a hierarchy table. You should replace the "Load ... From winedistricts.xls" with an appropriate statement that loads your hierarchy table.

But you may need to transform the hierarchy table while loading it. It all depends on the format of your hierarchy table.

HIC

Not applicable
Author

ok, what should i do if i have to represent the data in my listbox in a treeview or like a directory structure?

hic
Former Employee
Former Employee

For a tree-view list box, you need a path to the node, e.g. "The World/Europe/France/Bordeaux/Medoc/Bas-Médoc". Then you can set the listbox to tree view mode (ListBox properties - General - Show as Tree View).

The path field can be created in the Hierarchy statement: Use

  Hierarchy (NodeID, ParentID, NodeName, ParentName, NodeName, Path, '/', Depth)

  Load ...

HIC

Not applicable
Author

Can you explicitly tell me what i have to write in the following arguments to the heirarchy function:

Path:

Depth:

hic
Former Employee
Former Employee

I would write 'Path' and 'Depth'. These are both names of fields that are created by the Hierarchy statement and the parameters are used to name the new fields. Hence, they must not exist before.

HIC