Question

Create a "chaining" based on attributes with common value ?

  • 26 July 2019
  • 1 reply
  • 2 views

Hello,

I'm new with FME, and can't manage to solve an issue which seems simple.

 

I would like to merge several rows in one, based on same values for 2 attributes. I've obtained a list of unique name/date combinations with the matcher transformer.

Moreover, I'd like to create a unique feature for each match, using other attributes.

 

I tried to explain it with the example below :

I have the following data :

IDNameDatePlace_APlace_BPlace_C1Tom26-07HouseMarketSchool2Tom26-07MarketSchoolShop

 

3Jerry26-07House

 

Market

 

School

 

4Jerry03-08Market

 

School

 

Shop

 

 

 

Since the Name and Date are unique for rows 1 and 2, I want to merge them in a unique feature (which would be chain_1-2.

Then, I want to recreate a chaining House - Market - School - Shop, by comparing :

- Place_B (1) with Place_A (2)

- Place_B (2) with Place_A (3)

- and so on.

I'd like to obtain this kind of result :

IDNameDateChain_link_1Chain_link_2Chain_link_3Chain_link_4chain_1-2

 

Tom

 

26-07

 

House

 

Market

 

School

 

Shop

 

3

 

Jerry

 

26-07

 

House

 

Market

 

School

 

 

4

 

Jerry

 

03-08

 

Market

 

School

 

Shop

 

 

 

I've used a sorter by the ID, but then I'm stuck...

I guess I must create the new attributes with an AttributeManager, but have no idea how to compare different features atferwards.

There must be many possibilities with different transformers, but I've never succeeded...

 

Thanks for your help !


1 reply

Userlevel 2
Badge +17

Hi @teoj, thiw workflow might help you.

Reply