Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
desanip
Contributor
Contributor

Insert Flag update to "Y' for SCD Type 2

Hello Talendians,

I am trying to implement SCD type 2 in Talend using Flags. I know we can separate the inserts and updates using TMAP expressions. How do i implement this using a SQL Script?

 

Ex: I have 5 columns in a table. ID, Name, Address, ZIP, Hash( Concat of all the columns). If the next value of hash is also the same i want to flag it to Y and insert the new record with Flag N.

How do i achieve this? 

 

 

Labels (2)
1 Reply
Anonymous
Not applicable

Hi,

 

    Below link can help you to create MD5 hash.

 

https://community.talend.com/t5/Design-and-Development/How-to-generate-MD5-hash-value/td-p/43927

 

    Once the hash value is present, its a matter of doing inner join between main table and new data available in staging table. All matched columns can be marked as Update and all unmatched are candidates for insert.

 

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