Skip to main content
Solved

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


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.

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

7 replies

nielsgerrits
VIP
Forum|alt.badge.img+54
  • 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
  • June 19, 2023
nielsgerrits wrote:
  • 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+54
celita wrote:

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
  • June 19, 2023
celita wrote:

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+54
celita wrote:

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+48
  • Evangelist
  • 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
  • July 3, 2023
geomancer wrote:

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!


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