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 | UKALN | POSNR | TYPPS | GGG |
100011611 | 100011613 | 1 | J | 10 |
100011611 | 100011614 | 2 | J | 20 |
100011611 | 100011615 | 3 | J | 30 |
100011611 | 100011616 | 4 | J | 40 |
100011611 | | 5 | Y | 50 |
100011611 | | 6 | Y | 60 |
100011611 | | 7 | Y | 70 |
100011611 | | 8 | Y | 80 |
100011613 | | 1 | V | 90 |
100011613 | | 2 | V | 100 |
100011614 | | 1 | V | 110 |
100011614 | | 2 | V | 120 |
100011614 | | 3 | V | 130 |
100011615 | | 3 | V | 140 |
100011616 | | 1 | V | 150 |
100012535 | 100012536 | 1 | J | 160 |
100012535 | 100012537 | 2 | J | 170 |
100012536 | | 1 | V | 180 |
100012537 | | 1 | V | 190 |
100012538 | 100012539 | 1 | J | 200 |
100012539 | | 1 | V | 210 |
100013186 | 100013188 | 1 | J | 220 |
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;