Skip to main content
Solved

Combine two CSV table based on matching feature

  • December 20, 2016
  • 7 replies
  • 29 views

Hello All,

FME Newby here. I have two separate csv tables with one matching column. The tables correspond to a hierarchical network and are filled with their ID's. Please take a look at the network image below.

CP's are always connected to TX's. Some TX's but not all, have upstream DTECH's.

I already have traced which CP connects to which corresponding upstream TX. I have separately traced which TX connects to which DTECH or if they are connected at all to any. I need to merge these two table as one. Please see the example image below.

I tried FeatureMerger matching TX_ID across both tables, but the duplicate TX_ID's are dropped. Any help would be greatly appreciated in this case thanks!

Best answer by erik_jan

The FeaureMerger is the right way to go, but you need to set "process duplicate suppliers" to Yes. Then add a list name. After the FeatureMerger you explode the list (ListExploder) to get the shown result.

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.

7 replies

erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • Best Answer
  • December 20, 2016

The FeaureMerger is the right way to go, but you need to set "process duplicate suppliers" to Yes. Then add a list name. After the FeatureMerger you explode the list (ListExploder) to get the shown result.


  • Author
  • December 20, 2016

The FeaureMerger is the right way to go, but you need to set "process duplicate suppliers" to Yes. Then add a list name. After the FeatureMerger you explode the list (ListExploder) to get the shown result.

Hi @erik_jan

 

Thanks for the answer. Do I take both Merger and NotMerged and explode the list?

erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • December 20, 2016
Hi @erik_jan

 

Thanks for the answer. Do I take both Merger and NotMerged and explode the list?
Not Merged will only be those records from table 1 that have no matching TX_ID in table 2. In your example that will be no records.

 

 


  • Author
  • December 20, 2016
Not Merged will only be those records from table 1 that have no matching TX_ID in table 2. In your example that will be no records.

 

 

My bad. I should have explained that even that case could happen. I want to export all the records from both tables regardless of match

 

 


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • December 20, 2016
My bad. I should have explained that even that case could happen. I want to export all the records from both tables regardless of match

 

 

In that case: Lead the Merged to the ListExploder and bypass the ListExploder from the NotMerged (as no list will be created).

 

 


  • Author
  • December 20, 2016

The FeaureMerger is the right way to go, but you need to set "process duplicate suppliers" to Yes. Then add a list name. After the FeatureMerger you explode the list (ListExploder) to get the shown result.

This works great! Thanks

 

 


fmelizard
Safer
Forum|alt.badge.img+21
  • Safer
  • December 20, 2016
This works great! Thanks

 

 

You may also have gotten results more easily by flipping which was the Supplier and which was the Requestor. I think if "Table 1" was the Requestor and "Table 2" the supplier, you'd just get what you want without any need for lists...but I'm not 100% sure without trying. But worth being aware of that option when dealing with FeatureMerger.

 

 

Aside: We are working on a "FeatureJoiner" that will do Inner/Outer joins so that our Database educated friends will easily be able to spot solutions to problems like this in the future. Until FME 2018, though, FeatureMerger is the only show in town.