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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Iterative Insert

Let’s say I have more  than 100  records in my source table and I have 3 destination tables A,B,C. I have to insert first 1 to 10 records in A then 11 to 20 in B and 21 to 30 in C.Then again from 31 to 40 in A, 41 to 50 in B and 51 to 60 in C……So on up to last record. How can i do this in talend ?

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Maybe I would do that this way.

 

in a tmap component with a numeric sequence like your other post, I would create three outputs, toTableA, toTableB and toTableC and I would put in each where condition an operation like rownumber div 10, and then the result mod 3, this will give you a number between 0 and 2. If it's 0 then toTableA, if it's 1 toTableB and if its 2 toTableC so you could have in the toTableA output something like that: (rownumber / 10)%3 = 0 , in the toTableB output something like that: (rownumber / 10)%3 = 1 and in the toTableC output something like that: (rownumber / 10)%3 = 2

 

If there's more than 100 rows, then you'd have to div 10 until the result is less than 10

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Maybe I would do that this way.

 

in a tmap component with a numeric sequence like your other post, I would create three outputs, toTableA, toTableB and toTableC and I would put in each where condition an operation like rownumber div 10, and then the result mod 3, this will give you a number between 0 and 2. If it's 0 then toTableA, if it's 1 toTableB and if its 2 toTableC so you could have in the toTableA output something like that: (rownumber / 10)%3 = 0 , in the toTableB output something like that: (rownumber / 10)%3 = 1 and in the toTableC output something like that: (rownumber / 10)%3 = 2

 

If there's more than 100 rows, then you'd have to div 10 until the result is less than 10