Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
I have the below scenario:
my data looks something like this
Cust 1 startdate 1 end date1
Cust1 Startdate 2 enddate2
123 201803 201907
123 201909 202003
Basically there is a gap of few months between enddate1 and startdate2.
The output expected is range of month-year from startdate1 to enddate1 and then again from startdate2 to end date2.
123 201803
123 201804
|. . |
123 201906
123 201909
| |
123 202003
Is there a way to generate this kind of output in redshift database or implement this logic through Talend components?
You can use the following steps to get the job done :
(For testing purposes I had added a third line in the input data. I removed this line before taking screenshots)
I hope that answers your question..
Hi, via talend you could use this :
if input are String
TalendDate.diffDate(TalendDate.parseDate("yyyyMM",(String of start date)), TalendDate.parseDate("yyyyMM",(String of end date)), "MM")
if input are date :
TalendDate.diffDate(start date),(end date), "MM")
Send me love and kudos
@guenneguez jeremy : Hello, I need the list of months between the 2 dates.,not the number of months. Is there a way in redshift ot get this?
You can use the following steps to get the job done :
(For testing purposes I had added a third line in the input data. I removed this line before taking screenshots)
I hope that answers your question..