Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
Employee
Employee

Re: 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.

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

11 Replies
Employee
Employee

Re: 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.

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

Re: 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.

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.

Employee
Employee

Re: 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.

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

Re: 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.

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??

Employee
Employee

Re: 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.

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

Re: 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.

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

Employee
Employee

Re: 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.

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

Re: 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 you explicitly tell me what i have to write in the following arguments to the heirarchy function:

Path:

Depth:

Employee
Employee

Re: 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.

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

Community Browser