Solved

Transpose rows to columns

  • 13 April 2019
  • 7 replies
  • 426 views

Badge

This is my dataset:

ZwemplekVoorzieningAanwezigAAAAToilettenjaAAAAHorecajaAAAADouchesneeAAAAEHBOjaAAAAParkeerplaatsneeBBBBToilettenneeBBBBHorecaneeBBBBDouchesneeBBBBEHBOjaBBBBParkeerplaatsneeCCCCHorecajaCCCCDouchesjaCCCCEHBOjaCCCCParkeerplaatsja

 

The number of rows in the input dataset may vary or the order of the rows may change.

How do I transpose the rows to columns?

My resulting dataset should be like this:

 

ZwemplekToilettenHorecaDouchesEHBOParkeerplaatsAAAAjajaneejaneeBBBBneeneeneejaneeCCCCjajajajaja

 

icon

Best answer by takashi 14 April 2019, 00:10

View original

7 replies

Userlevel 5
Badge +30

Hi @friesewoudloper

There is a insteresting link and Workspace template that I believe is good in your case:

 

https://knowledge.safe.com/articles/31701/transpose-a-table-using-fme.html

 

Thanks,

Danilo

Userlevel 3
Badge +17

Alternatively, this workflow also might help you.

Badge

Alternatively, this workflow also might help you.

Excellent! Thank you @takashi!
Badge +2

Great solution from @takashi so I've added the example workspace and data so others can reference it. (FME 2018.1): tabletranspose.fmwt

Alternatively, this workflow also might help you.

Hello Mr. Takashi,

I was trying to use your example for my dataset but it is not working at all. I am a student at Niagara College Canada and working on thermal analysis for my thesis to create heatmaps for which I need the data matrix. The data is similar to the data shown. I have attached my template in order to give you a better idea of what I did. It would be really great of you if you could help me find a solution to my problem.

 

 

matrix.fmwt

Badge

Great solution from @takashi so I've added the example workspace and data so others can reference it. (FME 2018.1): tabletranspose.fmwt

This is the output I get when I run that. Is this right? FME 2019.

It looks as though AttributeCreator is not creating any fields, so it's not providing the desired output table.

I have not been able to get AttributeCreator to create fields from values in another field when testing on my own data.

Thank you,

Randy McGregor

Badge +2

This is the output I get when I run that. Is this right? FME 2019.

It looks as though AttributeCreator is not creating any fields, so it's not providing the desired output table.

I have not been able to get AttributeCreator to create fields from values in another field when testing on my own data.

Thank you,

Randy McGregor

@ramcgreg The attribute isn't displayed in the Table, but if you check the Feature Information window it is there. Just not added to the workbench schema which populates the table view.

Reply