Skip to main content
Solved

Transposing and aggregating data from Objectid,parameter,value to table with Objectid and parameters as columns.

  • June 19, 2023
  • 7 replies
  • 74 views

I am trying to get from a table like this example:

Inputto this table:

OutputI have searched for answers but can't fully seem to get where I need to be- including trying variations of attribute transposer, attribute exploder, attribute exposer, and attribute pivot (this helped me get closer to the answer but didn't allow for text..). Any advice would be much appreciated!

Best answer by nielsgerrits

  • AttributeCreator to create attributes from attributes
    • Set Parameter as AttributeName
    • Set Value as AttributeValue
  • AttributeExposer to expose attributes created in previous step
    • Expose attrributes colour, lenght, thickness, broken
  • Aggregator to merge the rows with same objectid in one line.
    • Group by ObjectId
    • Merge attributes.

 

Exposing the attributes can not be done automatically. If you want to do this automatically you can use a SchemaScanner and write the data dynamic.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • Best Answer
  • June 19, 2023
  • AttributeCreator to create attributes from attributes
    • Set Parameter as AttributeName
    • Set Value as AttributeValue
  • AttributeExposer to expose attributes created in previous step
    • Expose attrributes colour, lenght, thickness, broken
  • Aggregator to merge the rows with same objectid in one line.
    • Group by ObjectId
    • Merge attributes.

 

Exposing the attributes can not be done automatically. If you want to do this automatically you can use a SchemaScanner and write the data dynamic.


  • Author
  • 7 replies
  • June 19, 2023
  • AttributeCreator to create attributes from attributes
    • Set Parameter as AttributeName
    • Set Value as AttributeValue
  • AttributeExposer to expose attributes created in previous step
    • Expose attrributes colour, lenght, thickness, broken
  • Aggregator to merge the rows with same objectid in one line.
    • Group by ObjectId
    • Merge attributes.

 

Exposing the attributes can not be done automatically. If you want to do this automatically you can use a SchemaScanner and write the data dynamic.

Thank you for a prompt response. This successfully creates the columns, however values are still in the value column rather than in the corresponding columns created. Is there something I am missing?

Process1Thank you in advance.


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • June 19, 2023

Thank you for a prompt response. This successfully creates the columns, however values are still in the value column rather than in the corresponding columns created. Is there something I am missing?

Process1Thank you in advance.

Almost there. In the AttributeCreator, you need to click the second arrow, select Attribute Value, then Paramater, so the field displays @Value(Parameter).


  • Author
  • 7 replies
  • June 19, 2023

Thank you for a prompt response. This successfully creates the columns, however values are still in the value column rather than in the corresponding columns created. Is there something I am missing?

Process1Thank you in advance.

thank you so much!! it has worked :)


nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • June 19, 2023

Thank you for a prompt response. This successfully creates the columns, however values are still in the value column rather than in the corresponding columns created. Is there something I am missing?

Process1Thank you in advance.

Cheers :)


geomancer
Evangelist
Forum|alt.badge.img+58
  • Evangelist
  • 932 replies
  • June 20, 2023

An alternative way (because it is nice to have a choice):

  • Create a list (ListBuilder)
  • Extract the key value pairs (ListKeyValuePairExtractor from FME Hub)
  • Expose the attributes (AttributeExposer)

Transpose


  • Author
  • 7 replies
  • July 3, 2023

An alternative way (because it is nice to have a choice):

  • Create a list (ListBuilder)
  • Extract the key value pairs (ListKeyValuePairExtractor from FME Hub)
  • Expose the attributes (AttributeExposer)

Transpose

Thank you! love having an alternative too!