Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
joe86
Contributor
Contributor

Get 3 Year 7 days future data

Hi All,

I need to compare date with 3years future date.

Basically, I need to compare if the incoming date is lesser/greater than (current day+3yrs 7days) of future date. For example, if the incoming date is 20/dec/2021, i need to check if this is greater than (current day+3yrs 7days = 7/dec/2021). how to achieve this in tMap?

Can someone please help me in this?

Labels (2)
1 Solution

Accepted Solutions
manodwhb
Champion II
Champion II

@joe86,you can add the 3years 7days as shown in below in tmap.

 

TalendDate.addDate(TalendDate.addDate(TalendDate.getCurrentDate() ,7,"dd"),3,"yyyy") 

 

for comparison you should do below way.

TalendDate.compareDate(row2.date1 ,row2.date2 )==1 if it 1 means date1 is grater than date2,if it is -1 means date1 is less than date2,if it is 0 means date1 is equal to date2. you can do all these in tMap.

View solution in original post

5 Replies
joe86
Contributor
Contributor
Author

@manodwhb

any help please 0683p000009MACn.png

manodwhb
Champion II
Champion II

@joe86,you can add the 3years 7days as shown in below in tmap.

 

TalendDate.addDate(TalendDate.addDate(TalendDate.getCurrentDate() ,7,"dd"),3,"yyyy") 

 

for comparison you should do below way.

TalendDate.compareDate(row2.date1 ,row2.date2 )==1 if it 1 means date1 is grater than date2,if it is -1 means date1 is less than date2,if it is 0 means date1 is equal to date2. you can do all these in tMap.

vapukov
Master II
Master II

does 20/dec/2021 + 3 year + 7 days == 7/dec/2021 ?

 

may be 27/dec/2021?

 

you can use this formula in tMap

TalendDate.addDate(TalendDate.addDate(TalendDate.getCurrentDate(),3,"yyyy"),7,"dd")

replace TalendDate.getCurrentDate() with your own date column

vapukov
Master II
Master II

--

joe86
Contributor
Contributor
Author

thanks. Its CurrentDate+3yrs+7days.