Skip to main content

Hi,

Please, any transformer suggestion about how transpose the Table1 into Table2 ?

 

Table1

ID Field2005 Field2006 Field2009 Field2018

1 10.0    28.0  23.8    -3.8

2 80.0    34.0    -3.8    40.0

 

Table2

ID YEAR VALUE

1 2005 10.0

1 2006 28.0

1 2009 23.8

1 2018 -3.8

2 2005 80.0

2 2006 34.0

2 2009 -3.8

2 2018 40.0

 

Neither of List transformers nor AttributeExploder + Aggregator transformers work in this case. I have been working with these examples 1] but I don't get exactly what I need. 

 

Before using PythonCaller I would like to inspect other transformer possiblities. So, any FME workpace example or transformer suggestion is apreciated.

 

Thank you

 

r1] https://community.safe.com/s/article/transpose-a-table-using-fme

AttributeExploder and then a bit of tidying up should work

Capture 


AttributeExploder and then a bit of tidying up should work

Capture 

Thank you very much for your quick answer !!!

I'm sorry, I see that my sample data is confusing: the field ID is not an autonumeric, it is a char code that must be included in each outout record.

For this reason I was trying to use Aggregator Transfomer.

 

To be more expecific, if I have this input.xls file:

fmeinputI would like to have this output.xls file,

fmeoutput 

Up to now, I have this result, so I'm working in some king or aggregation by CODE field.

fmeresultThanks for your help @ebygomm​ 


Thank you very much for your quick answer !!!

I'm sorry, I see that my sample data is confusing: the field ID is not an autonumeric, it is a char code that must be included in each outout record.

For this reason I was trying to use Aggregator Transfomer.

 

To be more expecific, if I have this input.xls file:

fmeinputI would like to have this output.xls file,

fmeoutput 

Up to now, I have this result, so I'm working in some king or aggregation by CODE field.

fmeresultThanks for your help @ebygomm​ 

Should there be a file attached here?

 

"the field ID is not an autonumeric, it is a char code that must be included in each output record."

 

In the above example the ID will be included in every record, it doesn't matter what the value of it is. It exists due to the setting on the AttributeExploder being set as Keep Attributes to Yes


Thank you very much for your quick answer !!!

I'm sorry, I see that my sample data is confusing: the field ID is not an autonumeric, it is a char code that must be included in each outout record.

For this reason I was trying to use Aggregator Transfomer.

 

To be more expecific, if I have this input.xls file:

fmeinputI would like to have this output.xls file,

fmeoutput 

Up to now, I have this result, so I'm working in some king or aggregation by CODE field.

fmeresultThanks for your help @ebygomm​ 

Yes, the images were not attached in the first reply.

Now you can see sample files.

Thanks @ebygomm​  for your time !


It's exactly the same principle, just some slightly different handling due to the field names, but still AttributeExploder>Tester>AttributeCreator>AttributeKeeper

Capture 


Thank you very much for your quick answer !!!

I'm sorry, I see that my sample data is confusing: the field ID is not an autonumeric, it is a char code that must be included in each outout record.

For this reason I was trying to use Aggregator Transfomer.

 

To be more expecific, if I have this input.xls file:

fmeinputI would like to have this output.xls file,

fmeoutput 

Up to now, I have this result, so I'm working in some king or aggregation by CODE field.

fmeresultThanks for your help @ebygomm​ 

Yes, you are right, in AttributeExploder transformer Keep Attributes must be Yes.

Thanks a lot, the problem is solved !!!


Reply