Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create Hierarchy from flat table structure

Hierarchy offered by QlikView seems to work with the fashion of NodeID-ParentID.

We are using flat table structure to define hierarchies. eg -

Product_Level_5,Product_level_4,Product_level_3,Product_level_2,Product_level_1

How do I load this data in "hierarchy" fashion? I am curious to use Tree View List box in QV 9.

I thought QlikView can show data in tree fashion if a "group" is attached to a listbox... But looks like the data itself has to be defined in hierarchical way during the load script..

Appreciate any help.... Thanks!

14 Replies
pdumas
Partner - Contributor III
Partner - Contributor III

Hi

I suggest you just concatenate the fields with a "/" as separator

Then display the concatenated field in a list box

check the "show as treeview" property

Thats it

Pierre.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The Tree View breaks up any field by a given delimiter. So given a Field named "Product" with contents
"Sports, Winter, Outdoor, Skis"

Product would could be placed in a List Box with the delimiter set to " , " and displayed as a Tree View.

You can build the value of Product any number of ways. Hierarchy statements are only one way.

-Rob

Not applicable
Author

May be I didnt understand completely.. but if I define a list box using expression such as - ProdctLevel5 & ", " & ProdctLevel4 & ", " ProdctLevel3 and use ", " as a delimiter then it shows the tree however any selection made inside tree wont affect other charts...

also selection made on other charts/tables should make corresponding selection in the tree...

can you please explain what am I missing here?!

thanks for your help..

Not applicable
Author

Bump!

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Building the list as an listbox expression won't link to anything. I thought your rows already had the "product1, product2, ..." as keys. Could you post a bit of sample data or a qvw so we can understand what your data looks like?

-Rob

Not applicable
Author

Any suggestions? I agree with nrbhattad. Simply using a list box and checking show tree view doesn't work the way intend a hierachy to work. There has to be a different way!!!

wizardo
Creator III
Creator III

qlikview takes the fashion of NodeID-ParentID.and by the use of the hirarchy statement creates the same flat table you already have

in addition to that it creates a field that contains the concatenated values of each row's individual new column

(Product_Level_5,Product_level_4,Product_level_3,Product_level_2,Product_level_1) and puts a delimiter in-between like this

Product_Level_5/Product_level_4/Product_level_3/Product_level_2/Product_level_1 this new field (default name it path) is the field you use in the new treebox

what you can do if you already have the flat table is to create the field yourself and use it in the treebox and then you will get the selections you want.

the trick with using a concatenated expression in the treebox enables you to create hierarchies on the fly with out first creating them in the script

Mansyno

Not applicable
Author

Thanks Mansyno for your reply. I've already tried what you're suggesting. Not to repeat myself, unfortunately it doesn't work the way I intend it to work. I can see the tree structure. The way it works using hierarchy load is when you click on the parent, all its children are selected. However, with you're suggestion I cannot make use of that ability. In fact, I cannot make any selection from the list box.

If there is another way, please suggest. Thanks

Vishal

wizardo
Creator III
Creator III

hi

maybe i wasnt understood

i didnt mean to concat the values in an expression in the list box

i ment concat it already in the script

the it will be linked to the other records and you will be able to selct the lower levels