Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

Greater than equal to and less than equal to in tmap

Highlighted
Six Stars

Greater than equal to and less than equal to in tmap

HellO All,

Can you please help me with the below scenario.

If CREATEDON <= END_DATE and CREATEDON >= START_DATE then get the ACADEMIC_TERM_KEY

 

1.PNG

 

Please help me how and where to write this condition in tmap.

Thanks


Accepted Solutions
Highlighted
Five Stars

Re: Greater than equal to and less than equal to in tmap

The first thing to do is to compare the two dates .

TalendDate.diffDate(date1 ,date2) : the diffDate function return the difference between two dates 

 if diffDate return   0                     then date 1 = date 2 .
if diffdate return something <0  then date 1 < date 2.
if  diffdate return  something >0 then  date1 > date 2 .
So in your case:  
Add this expression in the filter of row6 input. ( push on the first green arrow )  


(TalendDate.diffDate(row17.CREATEDON,row6.END_DATE=<0 
&& 
TalendDate.diffDate(row17.CREATEDON,row6.START_DATE) >=0 )

 

View solution in original post


All Replies
Highlighted
Five Stars

Re: Greater than equal to and less than equal to in tmap

The first thing to do is to compare the two dates .

TalendDate.diffDate(date1 ,date2) : the diffDate function return the difference between two dates 

 if diffDate return   0                     then date 1 = date 2 .
if diffdate return something <0  then date 1 < date 2.
if  diffdate return  something >0 then  date1 > date 2 .
So in your case:  
Add this expression in the filter of row6 input. ( push on the first green arrow )  


(TalendDate.diffDate(row17.CREATEDON,row6.END_DATE=<0 
&& 
TalendDate.diffDate(row17.CREATEDON,row6.START_DATE) >=0 )

 

View solution in original post

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Introduction to Talend Open Studio for Data Quality

Find out about Talend Open Studio for Data Quality

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud reg...

Learn how to deploy Talend Jobs as Docker images to Amazon, Azure and Google Cloud registries

Blog