Skip to main content
Solved

Conditionally Merge Data from Two tables

  • May 27, 2016
  • 2 replies
  • 27 views

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)

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

takashi
Celebrity
  • 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

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