Solved

Transpose a table by attribute but retain the rest

  • 28 September 2018
  • 7 replies
  • 4 views

This is what I have

This is what I need

As you can see I need to transpose the ID but retaining the rest. I am unsure how to phrase the question so I guess the images shows my problem better than my phrasing!

My table has more than thousand records and I tried many combinations of sorter, counter, attributeexploader and so on until the point that I am very confused as how to even approach this in FME. Any suggestions are appreciated! And yes, I'm very new to FME. Output should be a csv but that is less of a concern right now.

icon

Best answer by takashi 29 September 2018, 04:11

View original

7 replies

Badge +2
Hi @majkiboy,

 

 

FME cannot have multiple attributes (column headers) with the same name because it will always treat them as one, so it will be difficult to achieve what you are after. I think you would need to rename each attribute according to that ID e.g (ID_2, Level_2, Time_2) to be able to display them like you wish, which if achievable would end up being quite complicated.

 

Hi @majkiboy,

 

 

FME cannot have multiple attributes (column headers) with the same name because it will always treat them as one, so it will be difficult to achieve what you are after. I think you would need to rename each attribute according to that ID e.g (ID_2, Level_2, Time_2) to be able to display them like you wish, which if achievable would end up being quite complicated.

 

If anyhow I would end up with a table like you are talking about, that would be okay since it is easy to change those multiple entries of "ID_1, ID_2, ID_3" and so on to just "ID". But I would need help how to even achieve the output you are talking about.

 

 

Userlevel 2
Badge +17

Hi @majkiboy, if the IDs are natural numbers (integers beginning with 1), the maximum ID is fixed and you can configure the destination schema statically, this workflow would be possible.

These are advanced challenges (FME 2018.1.0.2). Assuming IDs are natural numbers.

Hope this helps.

Badge +4
Are you really sure this is what you want? To me this looks like a format where your data will go to die. Its even more redundant than normalized data. If its for human readability, how about faning out sheet names? where you make an attribute like: sheet_name = ID_@Value(ID), and on your excel writer put Sheet Name = attribute sheet_name.

 

Are you really sure this is what you want? To me this looks like a format where your data will go to die. Its even more redundant than normalized data. If its for human readability, how about faning out sheet names? where you make an attribute like: sheet_name = ID_@Value(ID), and on your excel writer put Sheet Name = attribute sheet_name.

 

Yes, and it is unfortunately not my choice. This is someone else structure and I'm just rolling whit what I'm given!

 

Hi @majkiboy, if the IDs are natural numbers (integers beginning with 1), the maximum ID is fixed and you can configure the destination schema statically, this workflow would be possible.

These are advanced challenges (FME 2018.1.0.2). Assuming IDs are natural numbers.

Hope this helps.

In my table there are hundreds of different IDs. Would this still be possible then? Wouldn't the result writer box would get very big?

 

 

Userlevel 2
Badge +17

Hi @majkiboy, if the IDs are natural numbers (integers beginning with 1), the maximum ID is fixed and you can configure the destination schema statically, this workflow would be possible.

These are advanced challenges (FME 2018.1.0.2). Assuming IDs are natural numbers.

Hope this helps.

The advanced workspaces I posted above should work as expected, if the IDs are natural numbers (1, 2, 3, ...).

 

 

Reply