Question

post a question

  • 28 March 2014
  • 5 replies
  • 11 views

Badge
I have a large spreadsheet that looks like something like that:

 

 

 

Species                        Attribute_1    …    Attribute-n     Status_1    Status_2

 

Acarospora fuscata             aa           …          qe               VU            NS

 

Micarea misella                   xt           …          qq               CR            NR

 

Porpidia striata                   dd           …           rt                CR            NR

 

Verrucaria viridula                po           …          da               EN            NS

 

            …                          …            …          …               …             …

 

 

Is there a way in FME to obtain the following? The date above has to go to a another database that only accepts the next structure:

 

 

Species                        Attribute_1    …    Attribute-n     Statuses

 

Acarospora fuscata             aa           …          qe               VU

 

Acarospora fuscata             aa           …          qe               NS

 

Micarea misella                   xt           …          qq               CR

 

Micarea misella                   xt           …          qq               NR

 

Porpidia striata                   dd           …           rt                CR

 

Porpidia striata                   dd           …           rt                NR

 

Verrucaria viridula               po            …          da               EN

 

Verrucaria viridula               po            …          da               NS

 

            …                         …            …           …               …

 

 

 

Thanks!

5 replies

Userlevel 4
Hi,

 

 

look at the ListPopulator and the ListExploder.

 

 

David
Userlevel 2
Badge +17
Hi Darius,

 

 

If the number of Statuses are not so many, you can branch the feature flow into some streams, rename "Status_*" to "Statuses", and then write them together into the destination dataset.

 

 

 

Takashi
Badge +3
Or

 

 

Build 2 lists: list1 grouped by Species and status1 and list2 grouped by Species and status2.

 

Use listrenamer to rename list2/status2 to status1 (or visa versa)

 

Merge the lists.

 

Explode.

 

 

 

 

Gio
Userlevel 2
Badge +17
An element of list attribute can be considered as a non-list attribute whose name contains sequential number surrounded by curly braces. So, in some case, renaming could be a simple way to build a list attributes.

 

 

Badge

Thanks guys for your answers.

 

 

I have tried all the options and the one which has worked quicker it has been Takashi's one about creating two streams from the reader and then merge them again into the writer. The list thing also works but it's slighter longer.

 

 

Regards,

 

 

Dario

Reply