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.
Not applicable

Hierarchy item problem

Hello Qlikview gurus,

I'm new to Qlikview and I need to create a report. It is a recursive task.

I have a file like this:

    KALNR UKALNPOSNRTYPPSGGG
1000116111000116131J10
1000116111000116142J20
1000116111000116153J30
1000116111000116164J40
1000116115Y50
1000116116Y60
1000116117Y70
1000116118Y80
1000116131V90
1000116132V100
1000116141V110
1000116142V120
1000116143V130
1000116153V140
1000116161V150
1000125351000125361J160
1000125351000125372J170
1000125361V180
1000125371V190
1000125381000125391J200
1000125391V210
1000131861000131881J220

field KALNR contains the "Parent_ID" and the field UKALN contains the "Child_ID" code - they both represent the NODEs. If the field UKALN is empty, then it is a item and not a NODE. It can happen, that the Child UKALN also contains another value => next level of the hierarchy...this can go on up to let's say 10 levels...

I need to create a report where I will be able to see all the "nodes AND items" of the Parent_ID => e.g. the 1st Parent_ID in the table is 100011611 and this contains 4 nodes (100011613, 100011614, 100011615, 100011616) and several items that belongs to these Nodes according to field KALNR.

I did a simple hierarchy script which connects the Parent_IDs (field KALNR) with Child_ID (field UKALN), but I can't connect there also the items.

The "HierarchyBelongsto" doesn't work for me so I did REM on it...there are some othe field, but I think it would be enough for me if I can manage it with the table above.

Can you please help me??? Thanks a lot for any hint or solution.

*************************************************************************************

ExpandedAdjacentNodes:

Hierarchy(UKALN, KALNR, TYPPS) Load

UKALN,

KALNR,

text1

From (biff, embedded labels);

rem

Ancestors:

HierarchyBelongsto (UKALN, KALNR, text1, UKALN, text2)

LOAD

UKALN,

KALNR,

text1

Resident ExpandedAdjacentNodes;

Community Browser