Hi Team, i have requirement like below if hours greater than 30 then row should be slipted (hours/20) in multiple rows and (date-7) input task,hours,date xyz,40,2016/12/23 xyz,30,2016/11/12 output xyz,20,2016/12/23 xyz,20,2016/12/17 xyz,30,2016/11/12 pls help me i m not able to solve how can we do this in talend. thanks in advance. regards Shail
I responded to the other post you put up for this. Basically, it is a bit complicated to explain without lots of pictures and a lot of text. So instead, I put together an example of how to do this. Hope it helps. The example was built in Talend v562. It can be used by newer versions but not older versions. MultiplyRo… .zip
OK, I suggest upgrading since v54 is old. But here are some screen shots.... This shows the job layout. I am randomly generating some data, using a tMap with a tJavaFlex to split the rows as you asked. The tLogRow prints the result.
The tMap looks like this. The areas to focus on are circled in red...
The tJavaFlex looks like this. This is most important section. It generates rows for every row required by the input number (hours). So, if the number is 100, 4 rows are generated. 3 with 30 and 1 with 10 as the number (hours) returned....
If you are still confused I suggest you download v562 or v6 and use the example I posted.
I've shown you how to deal with the hardest part, any further changes to other columns can be dealt with in a similar way to how I changed the number of hours per row. For dates, you should look at the TalendDate routines. "addDate" will be useful.