Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marjan_it
Creator III
Creator III

how to make hirarchy using some different field

Hi All

I have some field that are organization chart like this:

 

RECEIVER_POST_L1_CHART_IDRECEIVER_POST_L2_CHART_IDRECEIVER_POST_L3_CHART_IDRECEIVER_POST_L3_CHART_NAME
1248
1249
12510
12511
13612
13613
13714

I want to show this data in listbox in as a treeview. how can I do this?!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe just create a new field with a concatenated string made of the four other fields, something like:

LOAD

     Level1,

     Level2,

     Level3,    

     Level4,

     Level1 &'/'& Level2 &'/'& Level3 &'/'& Level4 as HierarchyString

FROM ....

Then in the list box, enable option 'Show as treeview' in list box properties, general tab.

View solution in original post

5 Replies
swuehl
MVP
MVP

Maybe just create a new field with a concatenated string made of the four other fields, something like:

LOAD

     Level1,

     Level2,

     Level3,    

     Level4,

     Level1 &'/'& Level2 &'/'& Level3 &'/'& Level4 as HierarchyString

FROM ....

Then in the list box, enable option 'Show as treeview' in list box properties, general tab.

marjan_it
Creator III
Creator III
Author

IT shows hirarchy level but its not relation with other data and does not show the selected Item.

look at the attached file!!!

swuehl
MVP
MVP

It does show the relation to the selected value as possible value (white background in list box), don't you see it in your version?

2017-03-12 12_49_15-QlikView x64 - [C__Users_Stefan_Downloads_testHirarchy.qvw_].png

You can also create the hierarchy string as expression in the list box, just like a calculated dimension:

=RECEIVER_POST_L1_CHART_ID &'/'& RECEIVER_POST_L2_CHART_ID &'/'& RECEIVER_POST_L3_CHART_ID &'/'& RECEIVER_POST_L4_CHART_ID

Now, when you select the hierarchy item, all the underlying level values will be selected as well.

Same, when you select values in all levels, the hierarchy value in the list box will be selected (but not if you select e.g. only in the lowest level).

marjan_it
Creator III
Creator III
Author

Thank you for your complete answer.

another thing! if one of leaf was null if its parent selected it shows a white line after its parent.

if I want the parent be white what should  i do.

in another mean I want to omit null leaf ?!!!!!

swuehl
MVP
MVP

Guess you need to only append the part if it's not null:

=RECEIVER_POST_L1_CHART_ID &'/'& RECEIVER_POST_L2_CHART_ID &'/'& RECEIVER_POST_L3_CHART_ID & If(Len(RECEIVER_POST_L4_CHART_ID), '/'& RECEIVER_POST_L4_CHART_ID,'')