Tuesday, June 30, 2020

Talend: tUniqRow to Remove Duplicate Rows

tUniqRow Palette can be used to remove duplicate rows. You can define the unique row combination key in the Basic settings section.

Below, the keys attributes for a unique row are DateStart, PersonId and SourceSystemId



Talend: tFilterRow to Filter Null rows

tFilterRow Palette can be used to filter out unwanted rows from the output, here I am giving an example to filter out Null rows

Below, it is filtering out the rows where assignmentNumber is Null

In the 'Use advanced mode'
Relational.ISNULL(input_row.AssignmentNumber)?false:true


Talend: If Else Condition on tMap

In the recent ETL routine on the Talend job I had to compare two dates and select the greater one.

You have many predefined functions available on expression builder, I used TalendDate.compareDate function to compare the dates and If else condition to get the max one.

 Open the expression builder by clicking on three dots

Select the TalendDate.compareDate function and drag the date variables from the list 

TalendDate.compareDate(row2.ASS_START_DATE,row7.MGR_START_DATE)==-1?row7.MGR_START_DATE:row2.ASS_START_DATE 

Here, compareDate returns -1 if argumen1 is less than argument1

== represents IF, ? represents THEN and : represents ELSE here

Note: You use == for integer and .equals("") for string output.

Ex: row2.status.equals("Active")?"Select":"Ignore"