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: 
bhagyarekha
Creator II
Creator II

logic to split dates in talend

Hi All,

 

I have one requirement,my source has one date column as

date                     location

5-10 jan,14             x

 

i want my output as

date                 location

5-01-2014           x

6-01-2014           x

7-01-2014           x

8-01-2014           x

9-01-2014           x

10-01-2014          x

 

can we do this in talend.

please help me out

 

Thanks & regards

Rekha

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Yes you can. First of all, how much Java do you know? This will need a little bit of Java (not difficult stuff) to isolate the month and year (Jan, 14) from the day range. You can use String methods for this (see here https://docs.oracle.com/javase/7/docs/api/java/lang/String.html). You will then need to work out your "from" and "to" days. Again, String manipulation will be useful here. 

Once you have your date and day range known, you can implement some functionality to create a list of days that make up that range. This can be done with a tMap and a tJavaFlex as the lookup. I have written a tutorial which shows the approach I would suggest, here (https://www.rilhia.com/quicktips/quick-tip-row-multiplication). For every row you get which has your date+range value, this method will multiply it by the number of days in that range. So if you have a row with a range of 5 days, it will convert that single row into 5 rows, each with a different date.

I have purposefully not given you the Java you will need because I think it makes sense for you to work it out from what I have told you. If you have Java already, that will be easy. If you don't have Java, then if you are going to continue with Talend you will need it 🙂

View solution in original post

2 Replies
Anonymous
Not applicable

Yes you can. First of all, how much Java do you know? This will need a little bit of Java (not difficult stuff) to isolate the month and year (Jan, 14) from the day range. You can use String methods for this (see here https://docs.oracle.com/javase/7/docs/api/java/lang/String.html). You will then need to work out your "from" and "to" days. Again, String manipulation will be useful here. 

Once you have your date and day range known, you can implement some functionality to create a list of days that make up that range. This can be done with a tMap and a tJavaFlex as the lookup. I have written a tutorial which shows the approach I would suggest, here (https://www.rilhia.com/quicktips/quick-tip-row-multiplication). For every row you get which has your date+range value, this method will multiply it by the number of days in that range. So if you have a row with a range of 5 days, it will convert that single row into 5 rows, each with a different date.

I have purposefully not given you the Java you will need because I think it makes sense for you to work it out from what I have told you. If you have Java already, that will be easy. If you don't have Java, then if you are going to continue with Talend you will need it 🙂

Anonymous
Not applicable

Hi Rekha,

Did you able to solve this one?? I am still struggling.