Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to split row in multiple row

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
Labels (2)
6 Replies
Anonymous
Not applicable
Author

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
Anonymous
Not applicable
Author

Thanks for the reply but i m using talend 5.4.2 version of talend so i m not able to import the job 0683p000009MPcz.png.

can you please share some screenshots or steps  over here so that it can help me out to understand the scenario. 

it is very high priority requirement.

Thanks 
Shail
Anonymous
Not applicable
Author

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.
0683p000009MDbl.png
The tMap looks like this. The areas to focus on are circled in red...

0683p000009MDrP.png
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....

0683p000009MDrY.png
If you are still confused I suggest you download v562 or v6 and use the example I posted.
Anonymous
Not applicable
Author

Thanks for the help but how about date handling in each row?
based on condition if my row is split in two rows  then date should be -7 in each corresponding row which i have mentioned in my first post. 
 
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

thank you so much it helped a lot 0683p000009MACn.png