Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
@rchinta Date1 ( first date )
@rchinta Date1 ( second date )
@rchinta 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 🙂
@yashfreaky ,check the below links.
https://help.talend.com/reader/mhqCkTBnin7IXmJBUJoocQ/5qboCU~1NO4j7aF9JtCWNg
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
@rchinta Date1 ( first date )
@rchinta Date1 ( second date )
@rchinta 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 🙂