Skip to main content
Question

ChangeDetector for 2 colums as unique keys

  • July 22, 2020
  • 2 replies
  • 28 views

When doing the comparison, how to specify that my unique keys are going to be 2 columns?

 

 

1 column can have the same value in multiple rows, but there can not be two rows with the same value in the two columns.

 

 

Example:

 

 

This can happen

 

1 | apple | red |

 

2 | apple | green |

 

 

This can not happen

 

1 | apple | red |

 

2 | apple | red |

 

 

So in order to check which row has changed and update it or leave It unchanged, I need to specify two unique keys in ChangeDetector.

 

 

I have specified the two columns in *Update Detection Key Attributes* but not working as expected

 

 

May you advise?

 

 

Thanks
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

erik_jan
Contributor
Forum|alt.badge.img+26
  • Contributor
  • July 22, 2020

Another way of detecting duplicate keys would be using the DuplicateFilter transformer.

This allows multiple keys and has an output port for the first Unique value and all duplicates will be output from a Duplicate port.

Hope this helps.


Forum|alt.badge.img+2

@josesicajan ChangeDetector had a major overhaul in 2019 where the functionality of ChangeDetector and the HUB Custom transformer UpdateDetector were combined and improved.

I this example, I think you need to set the Attribute Matching Strategy: Match Selected Attributes and then select the two columns that you need to match. (Fruit & Colour)