Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
yashfreaky
Contributor
Contributor

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

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

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 🙂

View solution in original post

3 Replies
manodwhb
Champion II
Champion II

akumar2301
Specialist II
Specialist II

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.
Anonymous
Not applicable

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 🙂