Skip to main content
Solved

Conditionally Merge Data from Two tables


Forum|alt.badge.img+2

I have two tables, ITEM and SITE, where the ITEM values(columns ACTIVE, CHECKED, REPLACE) need to be merged with the SITE columns but if any of the multiple ITEM values is 'Y' it takes precedence over a value of 'N'. I have a solution using a FeatureMerger generating a list and then searching the list three times, once for each column.

However, this is an example and actually there are many columns that need to be added in this way. Just wondering if there is a more generic way of processing rather than a chained approach (no Python please).

Data in attached spreadsheet.

 

 

Best answer by takashi

Hi @mark_1spatial, two NullAttributeMappers might help you.

  1. Change the value "N" to <missing> with the 1st NullAttributeMapper before merging.
  2. Set "Yes" to the "Process Duplicate Suppliers" parameter of the FeatureMerger.
  3. Assign "N" to the missing ACTIVE, CHECKED and REPLACE columns with the 2nd NullAttributeMapper after merging.

See also the attached example: nullattributemapper-example.fmw (FME 2016.1)

View original
Did this help you find an answer to your question?

2 replies

takashi
Evangelist
  • Best Answer
  • May 27, 2016

Hi @mark_1spatial, two NullAttributeMappers might help you.

  1. Change the value "N" to <missing> with the 1st NullAttributeMapper before merging.
  2. Set "Yes" to the "Process Duplicate Suppliers" parameter of the FeatureMerger.
  3. Assign "N" to the missing ACTIVE, CHECKED and REPLACE columns with the 2nd NullAttributeMapper after merging.

See also the attached example: nullattributemapper-example.fmw (FME 2016.1)


Forum|alt.badge.img+2
  • Author
  • May 27, 2016
takashi wrote:

Hi @mark_1spatial, two NullAttributeMappers might help you.

  1. Change the value "N" to <missing> with the 1st NullAttributeMapper before merging.
  2. Set "Yes" to the "Process Duplicate Suppliers" parameter of the FeatureMerger.
  3. Assign "N" to the missing ACTIVE, CHECKED and REPLACE columns with the 2nd NullAttributeMapper after merging.

See also the attached example: nullattributemapper-example.fmw (FME 2016.1)

As always you make it look too simple. FME Legend!

Many Thanks


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings