Skip to main content
Solved

Transpose a table by attribute but retain the rest

  • September 28, 2018
  • 7 replies
  • 18 views

majkiboy
Contributor
Forum|alt.badge.img

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.

Best answer by takashi

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.

View original
Did this help you find an answer to your question?

7 replies

Forum|alt.badge.img+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.

 


majkiboy
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • September 28, 2018
hollyatsafe wrote:
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.

 

 


takashi
Influencer
  • Best Answer
  • September 29, 2018

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.


paalped
Contributor
Forum|alt.badge.img+5
  • Contributor
  • September 29, 2018
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.

 


majkiboy
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • October 2, 2018
paalped wrote:
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!

 


majkiboy
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • October 2, 2018
takashi wrote:

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?

 

 


takashi
Influencer
  • October 2, 2018
takashi wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings