Question

ChangeDetector for 2 colums as unique keys


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

2 replies

Userlevel 2
Badge +12

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.

Badge +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)

Reply