Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to find all descendants of each element in the parent column. First, my data contains 2 columns, 1 is the parents and the other is children. No levels are specified.
As illustrated in the picture, I need to transform the table on the left into the table on the right. Which means for each parent, I will need to get every of their descendants next to them.
Is there a way to do this in QLIK Sense?
Thanks!
one example using the HierarchyBelongsTo prefix:
https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefix...
table1:
HierarchyBelongsTo (Child,Parent,Descendant,Ancestor,AncestorName,DepthDiff)
LOAD *,
Child as Descendant
INLINE [
Parent, Child
, A
A, B
A, C
A, D
A, E
B, F
B, G
B, H
C, I
C, K
D, L
F, M
F, N
F, O
];
HI @myhanlam
I would start by having a read through the Hierarchy logic.
one example using the HierarchyBelongsTo prefix:
https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefix...
table1:
HierarchyBelongsTo (Child,Parent,Descendant,Ancestor,AncestorName,DepthDiff)
LOAD *,
Child as Descendant
INLINE [
Parent, Child
, A
A, B
A, C
A, D
A, E
B, F
B, G
B, H
C, I
C, K
D, L
F, M
F, N
F, O
];
This solution works well for me. Thanks Marco!