Skip to main content

Why isn't this easier in FME? I've tried lots of examples on the Hub, but can't get any of them to work. The Attribute Pivoter is difficult to use and never gives me the results I need. I can perform this very easily in SQL.

 

I'm trying to turn my rows Vxx into columns with the value of Litres, grouped by all the other rows. Any idea how I can achieve this? Thanks in advance!

 

Can you give an example of what the output should look like?


Certainly - find it attached!example.xlsx


I nearly always use pivot data by using the value of an attribute to create a new attribute with that name, then aggregate and merge attributes and expose the newly created attributes

You can import the values from the period column in the original input in the AttributeExposer

Gives this output


You can use the attribute pivoter though as well, you still need to expose the attributes if you want to see them on the canvas

The attribute pivoter does set up a schema for you which makes it slightly more straightforward to write th data out dynamically without exposing the attributes


I nearly always use pivot data by using the value of an attribute to create a new attribute with that name, then aggregate and merge attributes and expose the newly created attributes

You can import the values from the period column in the original input in the AttributeExposer

Gives this output

That would be perfect. Would you mind sending me your workflow? I'm on 2019.1.

 

Thank you very much for taking the time to help me with this - it's been driving me mad!


@nedwaterman Example workspace attached - it's in 2019.2 - it'll warn about the workspace not being compatible but should open correctly

pivot.fmwt


You can use the attribute pivoter though as well, you still need to expose the attributes if you want to see them on the canvas

The attribute pivoter does set up a schema for you which makes it slightly more straightforward to write th data out dynamically without exposing the attributes

Thanks very much ebgygomm - I've used this approach and it works beautifully. You've saved me from insanity!


@nedwaterman Example workspace attached - it's in 2019.2 - it'll warn about the workspace not being compatible but should open correctly

pivot.fmwt

Thank you - you have been a great help!


@ebygomm​ 

Thanks for the great pivot examples, these are perfect.


Reply