Merge Rows (diff)
Compare merging records ..
Workshop - Merge Rows (diff)
The Merge row (diff) compares the values between the merging rows and sets a ‘flag’.
In this workshop, you compare incoming records with reference 'golden' records to determine whether the record is Identical requires updating, inserting, or deleting:
Merge rows (diff) stream
Merge rows (diff) database
Create a new Transformation
Any one of these actions opens a new Transformation tab for you to begin designing your transformation.
By clicking File > New > Transformation
By using the CTRL-N hot key

Merge Rows (diff)
Let's say we're doing a delta load of new data at specific times ..
Based on keys for comparison, we can use this step to merge reference rows (previous data) with compare rows (new data) to create merged output rows.
A flag in the row indicates how the values were compared and merged. Flag values include:
identical
The key was found in both rows, and the compared values are identical.
changed
The key was found in both rows, but one or more compared values are different.
new
The key was not found in the reference rows.
deleted
The key was not found in the compare rows.
If the rows are flagged as deleted, the merged output rows are created based upon the original reference rows stream.
For identical, new, or changed rows, the merged output rows are created based upon the original compare rows stream.

Synchronize after merge
This step can be used in conjunction with the Merge Rows (diff) transformation step. The Merge Rows (diff) transformation step appends a Flag column to each row, with a value of "identical", "changed", "new" or "deleted".
This flag column is then used by the Synchronize after merge transformation step to carry out updates/inserts/deletes on a connection table.
This step uses the flag value to perform the sync operations on the database table.

Set the Key from both the Table and Stream.
Get the Table / Stream Fields and ensure mapping is correct.
Dont Update the Keys..!!

Operation fieldname
This is a required field. This field is used by the step to obtain an operation flag for the current row.
flagfield
Insert when value equal
Specify the value of the Operation fieldname which signifies that anInsert should be carried out.
new
Update when value equal
Specify the value of the Operation fieldname which signifies that an Update should be carried out.
changed
Delete when value equal
Specify the value of the Operation fieldname which signifies that a Delete should be carried out.
deleted
Perform lookup
Performs a lookup when deleting or updating. If the lookup field is not found, then an exception is thrown. This option can be used as an extra check if you wish to check updates/deletes prior to their execution.
RUN
This step is aimed at reporting data marts .. delta loads to update the cube. Check out which records have undergone CRUID operations.
View the data in the Table.

Run the Transformation with the hop between the Merge Rows (diff) and Synchronize after merge .. disabled.

Run the Transformation with the hop enabled.
Examine and compare the records.

Last updated
Was this helpful?
