Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Chain Loop in Data Integration

Hi

I have data like this

 

id        subid

23
35
410
57
78
89
1011
1115

 

I need output like this

 

Col1          Col2

23
35
57
78
89
410
1011
1115

 

Here subid of 2 is 3 then 3 will become id i need to get subid of 3 is 5 then this loop should close 

 

2--3

3--5

5--7

7--8

8--9

 

then next data 4

 

4--10

10--11

11--15

 

I want to do in Talend , what is the approach and which components need to use

 

If you need any clarification please comment 

 

Thanks in Advance 

Labels (2)
5 Replies
Jesperrekuh
Specialist
Specialist

What is your input type, database or file or ... ?
In database engines (Oracle) there's functionality to work with parent child:
CONNECT_BY_ROOT and is called hierarchical queries.
in java take a closer look, java doesnt have something build in so you have to do it yourself:
https://www.javagists.com/java-tree-data-structure
vboppudi
Partner - Creator III
Partner - Creator III

Hi Ravisankar,

 

Is there any other example? because for the above example if you sort data based on column 2 then data will be as expected out.

 

Regards,

Jesperrekuh
Specialist
Specialist

@vboppudi, no it wont...
parent child
1, 3
3, 7
4, 8
7, 12
8, 13
Take a closer look 0683p000009MA9p.png
vboppudi
Partner - Creator III
Partner - Creator III

This is the source data correct?

id        subid

23
35
410
57
78
89
1011
1115

 

Regards,

Anonymous
Not applicable
Author

Hi

 

Thanks for response

 

Sorry for the delay

 

Yes @vboppudi, its source data only

 

As @Dijke mentioned, its parent child only

 

example take record

parent  child

2             3

 

here 3 is child but 3 is in parent also and child is 5

 

Its like Self join and loop

 

2 loop is ending on 9

 

I need output like this

 

Col1          Col2

2 3
3 5
5 7
7 8
8 9
4 10
10 11
11 15

 

Regards

Ravisankar