Solved

How to transpose an attribute table?

  • 17 January 2023
  • 3 replies
  • 123 views

Userlevel 1
Badge +8

I need to transpose an attribute table and tried so far the StatisticsCalculator as well as the AttributePivoter, but do not get the result I need. In addition I was following the advice of Mark (@mark2atsafe​ ) in this posting at StackExchange.

 

While the advice from mark looks 'straight' forward, I struggle with the reader-as-resource since the data are produce through analysis within the workspace where I need to transpose the attributes.

 

After sorting my results I get the following attribute table

attribute tableand what I need is a structure like

 

image.png 

So, the attribute values from the 'label' column have the provide colum names, while 'Area_perc' has to provide the corresponding values for these columns, and everything is grouped by 'Sectorname'.

 

How can I achieve that within FME?

icon

Best answer by ebygomm 17 January 2023, 13:32

View original

3 replies

Userlevel 1
Badge +21

You should be able to follow the method posted here

 

https://community.safe.com/s/question/0D5Dm000006Zdi5KAC/transpose-a-table

Userlevel 1
Badge +8

@ebygomm​ Thanks a lot for the fast reply. I am surprised though that there is a difference in selecting an attribute when creating a new attribute in the AttributeCreator and writing 

@Value(label)

settings dialogWhen selecting an attribute from the context menu, it will set the value for the attribute to 'label' and nothing will happen with respect to the assignment of the correct values, while writing it as shown in the screenshot it does the trick!

Userlevel 1
Badge +21

@ebygomm​ Thanks a lot for the fast reply. I am surprised though that there is a difference in selecting an attribute when creating a new attribute in the AttributeCreator and writing 

@Value(label)

settings dialogWhen selecting an attribute from the context menu, it will set the value for the attribute to 'label' and nothing will happen with respect to the assignment of the correct values, while writing it as shown in the screenshot it does the trick!

It's not necessary to type, you just need to select Attribute Value from the menu (although typing it will work as well)

image

Reply