Skip to main content
Solved

Merge the primary dataset with the secondary dataset values, to show the primary dataset value merged with the values of each instance of the secondary dataset.


Forum|alt.badge.img

Hi,

I am trying to merge two datasets, one being the primary dataset that has Levels and the second dataset that has Zones. Each level has all the zones associated to that the level. I would like to achieve a dataset that displays this merged dataset. I have created a small sample of the actual larger dataset below.

Levels and Zones FME DatasetI think the solution involves some sort of list handling but I have tried out several list transformers but so far haven’t been successful, I would like the desired outcome in columns as shown above and not in rows as I think can be achieved by exploding attributes. 

If this cannot be achieved using transformers, I am happy to use a python script inside the pythoncaller if someone doesn’t mind sharing a script.

Appreciate any advice either way.  Thanks in advance.

Best answer by virtualcitymatt

Use an Aggregator to merge the secondary dataset into one (building a list out of the required attributes).

Next use a Feature Merger to join the aggregated feature (supplier) to the primary dataset(Requester) - use 1 = 1 in the feature merger.

This should give you the primary dataset each with a list attribute containing all​ secondary values.

Next use a ListExploder​, this should create a single feature for each element in the list.

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

2 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35
  • Celebrity
  • Best Answer
  • August 11, 2021

Use an Aggregator to merge the secondary dataset into one (building a list out of the required attributes).

Next use a Feature Merger to join the aggregated feature (supplier) to the primary dataset(Requester) - use 1 = 1 in the feature merger.

This should give you the primary dataset each with a list attribute containing all​ secondary values.

Next use a ListExploder​, this should create a single feature for each element in the list.


Forum|alt.badge.img
  • Author
  • August 11, 2021

Thank you @virtualcitymatt​ that suggestion worked a treat and I got the output I was looking for. I wasn’t aware that you could merge using the 1 = 1 in feature merger something I will have to look up and see what else I can merge beside the incoming attributes which I thought were obligatory. Thanks again. 


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