Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

marjan_it
Contributor 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
MVP
MVP

Re: how to make hirarchy using some different field

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.

5 Replies
MVP
MVP

Re: how to make hirarchy using some different field

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
Contributor III

Re: how to make hirarchy using some different field

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

look at the attached file!!!

MVP
MVP

Re: how to make hirarchy using some different field

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
Contributor III

Re: how to make hirarchy using some different field

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

MVP
MVP

Re: how to make hirarchy using some different field

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,'')