Skip to main content
Solved

Transpose Colums/Rows

  • April 17, 2024
  • 7 replies
  • 148 views

scootercat_nl
Contributor
Forum|alt.badge.img+5

Searched for possible solutions here, but nothing yet.

 

Have :
 

col0 col1 col2 col3 col4
Region A BU02851 BU02852 BU02853 BU02854
Region Value A 50 55 40 10
Region Value B 7 11 4 15
Region Value C 60 70 10 25

 

Need :

 

Region A Region Value C      
BU02851 60      
BU02852 70      
BU02853 10      
BU02854 25      

 

What steps do I need to take to get this done?

 

Thanks in Advance !

 

Best answer by joepk

Thanks for the push @liamfez, it is done 😎

What a relief, hehe.
Hope this helps!

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

7 replies

joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • April 17, 2024

I always avoid transposing in FME because it gives me such a headache. I wanted to challenge myself and do it this time. See attached workspace (FME 2021). I don't like how it turned out and I hardly understand what I am doing myself.

The hardcoded AttributeCreators are bothering me the most. It feels like this must be doable dynamically with some proper Aggregator/AttributeExploder list-based-merge-wizardry. Welp, maybe next time.

 


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • April 17, 2024

Perhaps a similar solution to this thread:

The solution I proposed in that thread is similar to what @joepk has already suggested. And I will agree with @joepk, transposing in either direction is certainly headache inducing.


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • April 17, 2024

I proposed a similar solution to what @joepk has suggested in another thread, but using the AttributeExploder set to list, followed up with a ListExploder. I will link it here once the post is approved.


joepk
Influencer
Forum|alt.badge.img+20
  • Influencer
  • Best Answer
  • April 18, 2024

Thanks for the push @liamfez, it is done 😎

What a relief, hehe.
Hope this helps!


scootercat_nl
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • April 18, 2024
joepk wrote:

Thanks for the push @liamfez, it is done 😎

What a relief, hehe.
Hope this helps!

Thank you very much for your efforts.
It's more complicated than I thought. But luckily I can move on :)
Hopefully you don't have a headache anymore.


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • April 18, 2024

Very nice!

Just a small note: you can skip Tester_3 (Filter out Features where attr_name Begins With "fme_”) when you tell the AttributeExploder to ignore attributes starting with "fme_” using the ‘Ignore Attributes Containing’ option (see below).

The field contains a regular expression, so enter ^fme_ (which means attributes that start with “fme_”).

 


liamfez
Influencer
Forum|alt.badge.img+34
  • Influencer
  • April 18, 2024
geomancer wrote:

Very nice!

Just a small note: you can skip Tester_3 (Filter out Features where attr_name Begins With "fme_”) when you tell the AttributeExploder to ignore attributes starting with "fme_” using the ‘Ignore Attributes Containing’ option (see below).

The field contains a regular expression, so enter ^fme_ (which means attributes that start with “fme_”).

 

One more reason I hope I get to update to Form soon, still using 2021 for the time being and that does not appear to be an option. That is a small but very handy update to that transformer.


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