Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
gottsmann
New Contributor II

Find value after using HierarchyBelongsTo

Dear all,

After using HierarchyBelongsTo(), I have this table. Please click on it for better quality:

Now I would like to:

1) Select a Node

2) See all corresponding AncestorIDs

3) See all Lenghts for the AncestorIDs, not for the Nodes.

When I select a Node, the lenghts all show the length of this node because in fact I selected only one line in the data model which is repeated for every new AncestorID:

A Straight Table also shows this result. The length is just calculated using the Length field. The expression is: "=Length" with Total Mode Min and Max turned on.

Now, when I

1) select the AncestorID with the highest DepthDiff (5937900 in this case) and

2) deselect the Node, I have what I need:

My question is:

How can I create a table where I

1) Select one Node

2) See all corresponding AncestorIDs

3) See all Lenghts for the AncestorIDs?

I tried various versions of Hierarchy() and HierarchyBelongsTo() from HIC's resources as well as set analyis and self joins, but did not get the right result. Please help.

Thank you in advance.

Community Browser