Relational Funtions

Five Stars

Relational Funtions

Hello,

 

Could any one please let me know, How to use these functions with any small scenario.

Relational.ISNULL(null)

Relational.NOT(true)

 

and also please see this below logic which i have seen in previous jobs and i didn't understood why they used this expression

!Relational.ISNULL(out.START_DT)?(TalendDate.diffDate(out.START_DT, out.visitdate)):000

Thanks and Regards
Yashwanth Basetty

Accepted Solutions
Employee

Re: Relational Funtions

Hi,

 

Below are my thoughts.

 

Relational.ISNULL(null)

   This function  will verify whether the data inside the bracket is null. Since you have given the value inside bracket as null itself, the function will always return true as output in this scenario.

 

Relational.NOT(true)

The NOT() will negate the boolean value and since you are giving true as the value inside the function, it will convert the data as false.

 

!Relational.ISNULL(out.START_DT)?(TalendDate.diffDate(out.START_DT, out.visitdate)):000

 

The first step here is !Relational.ISNULL(out.START_DT) which means you are checking whether out.START_DT is having null value or not. Since you have added "!" at beginnging it will negate the output. So the condition will act as true only if out.START_DT is not null. This is a method to verify whether a variable is having null value or not.

 

Now, the next set is condition?Yes value: No value. I believe I have explained the details here itself. In your case, if start_dt is not null, it will go to the first part ie, (TalendDate.diffDate(out.START_DT, out.visitdate)) and if it is null, the output value will be 000.

 

Now the last function in query i.e. (TalendDate.diffDate(out.START_DT, out.visitdate)) is doing a difference between two date fields. Below is the description given in Talend tMap Help.

 

return difference between two dates

@param Date1 ( first date )
@param Date1 ( second date )
@param dateType value=("yyyy","MM","dd","HH","mm","ss","SSS") for type of return
@return a number of years, months, days ... date1 - date2

 

Hope you got answer to your query :-)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

All Replies
Thirteen Stars

Re: Relational Funtions

Nine Stars

Re: Relational Funtions

Below link explains
https://help.talend.com/reader/nXPtKhielAtSqFD6_f7~OQ/u5~64RfyDtd7PaXNIiefOg

expression means ,

if STD_DT is null then 000 else
difference of days ( in Millisecond) between visitdate and Start_dt.
Regards
Abhishek KUMAR
( Please mark the post as resolved if you found your solution )
Employee

Re: Relational Funtions

Hi,

 

Below are my thoughts.

 

Relational.ISNULL(null)

   This function  will verify whether the data inside the bracket is null. Since you have given the value inside bracket as null itself, the function will always return true as output in this scenario.

 

Relational.NOT(true)

The NOT() will negate the boolean value and since you are giving true as the value inside the function, it will convert the data as false.

 

!Relational.ISNULL(out.START_DT)?(TalendDate.diffDate(out.START_DT, out.visitdate)):000

 

The first step here is !Relational.ISNULL(out.START_DT) which means you are checking whether out.START_DT is having null value or not. Since you have added "!" at beginnging it will negate the output. So the condition will act as true only if out.START_DT is not null. This is a method to verify whether a variable is having null value or not.

 

Now, the next set is condition?Yes value: No value. I believe I have explained the details here itself. In your case, if start_dt is not null, it will go to the first part ie, (TalendDate.diffDate(out.START_DT, out.visitdate)) and if it is null, the output value will be 000.

 

Now the last function in query i.e. (TalendDate.diffDate(out.START_DT, out.visitdate)) is doing a difference between two date fields. Below is the description given in Talend tMap Help.

 

return difference between two dates

@param Date1 ( first date )
@param Date1 ( second date )
@param dateType value=("yyyy","MM","dd","HH","mm","ss","SSS") for type of return
@return a number of years, months, days ... date1 - date2

 

Hope you got answer to your query :-)

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)


Warm Regards,
Nikhil Thampi
Please appreciate our members by giving Kudos for spending their time for your query. If your query is answered, please mark the topic as resolved :-)

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.