Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have one source table,the data in source table is like,
I have 3 target tables T1,T2 and T3. I want the output as follows,
The data in T1 should be,
The data in T2 should be,
The data in T3 should be,
How an i Achieve that in talend?
Note: I am using Mysql database.
Connect your data to a tMap with 3 outputs. Create an integer tMap variable with a sequence generator....
routines.Numeric.sequence("seq", 1, 1)
In each of your outputs use a filter with following logic....
Table1
Var.seq%3==1
Table2
Var.seq%3==2
Table3
Var.seq%3==0
This is using a modulus operator which will return 1 when a number is not divisible by 3 and has a remainder of 1, 2 when a number is not divisible by 3 and has a remainder of 2 and 0 when the number is divisible by 3. This will allow you to cycle your outputs as you wish
Connect your data to a tMap with 3 outputs. Create an integer tMap variable with a sequence generator....
routines.Numeric.sequence("seq", 1, 1)
In each of your outputs use a filter with following logic....
Table1
Var.seq%3==1
Table2
Var.seq%3==2
Table3
Var.seq%3==0
This is using a modulus operator which will return 1 when a number is not divisible by 3 and has a remainder of 1, 2 when a number is not divisible by 3 and has a remainder of 2 and 0 when the number is divisible by 3. This will allow you to cycle your outputs as you wish
Forgot this post.