Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sbxr
Contributor III
Contributor III

preventing duplicates with condition in Talend job

FYI @shong 

Hi,

 

i have a scenario to handle  please help.

i am having two fields maxName and maxId in table for which based on condition i need to prevent duplicates entering the output flow.

Scenario 1: If maxName is same then keep maxId as it is to the output flow but if the  maxName is different then blankout the maxId,maxCODE fields , same as output shown below: how can i achieve this please help.

Input:

maxName maxId maxCODE
Hello HE HE
Hello HE HE
Jello JE JE
xyz JE JE

 

Output:

maxName maxId maxCODE
Hello HE HE
Hello HE HE
Jello JE JE
xyz NULL NULL

 

Regards

 

Labels (2)
3 Replies
manodwhb
Champion II
Champion II

@sbxr , you can try to use with variables in tMap.

 

TRF
Champion II
Champion II

Local tMap variables or tMemorizeRows + tJavaFlex should help for your case.

Remember than local tMap variables are evaluated in the same order they are defined for each input record.

So you can compare current row fields with preceding if you declare the required set of variables.  

sbxr
Contributor III
Contributor III
Author

Hi @manodwhb

Thanks for the reply, i am not able to apply the solution ,if possible please help me using a demo job.

Thanks