Skip to main content
Solved

Creating New Features from Attribute Values

  • January 23, 2025
  • 7 replies
  • 52 views

bretr
Contributor
Forum|alt.badge.img+2
  • Contributor

Hello,

 

I’m struggling with the logic/approach on this one.

 

I have a spreadsheet of fuel filters.

 

So in the spreadsheet, it looks kind of like this:

 

Unit#/Fuel 1/Fuel2/Air 1/Air2

12/abc123/abc223/airf123/airf124

13/abc123/abc212/airf123/airf124

 

I want to create output data that looks something like this:

 

Unit/Filter Class/Filter Number

12/Fuel Filter/abc123

12/Fuel Filter/abc223

12/Air Filter/airf123

13/Fuel Filter/abc123

13/Fuel Filter/abc212

 

Hopefully this makes sense.


Any thoughts on an approach, or some transformers I should work with?

 

Cheers!​​​​​

Best answer by ebygomm

An attribute exploder with an attribute manager to tidy things up should work here

 

 

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

7 replies

arenscott
Contributor
Forum|alt.badge.img+5
  • Contributor
  • January 23, 2025

Interesting question, I can’t really answer it so I’m also curious what the ideas of more FME experienced people will be.

One thought I had was using the Test filter.
One feature would arrive in the Test filter -  ex 12/abc123/abc223/airf123/airf124
You would set up the test filter to create features based on the presence of values like ex /Fuel 1/Fuel2/Air 1/Air2.

So essentially one input feature would be ‘exploded’ into several output ports, you would then combine them in a downstream transformer or writer.

I wonder if there is a more elegant solution, like an ‘exploder’ that uses attribute logic


bretr
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • January 23, 2025

Tester might actually work, I will test with that.  I was thinking about using Lists somehow, but didn’t have luck with that...


arenscott
Contributor
Forum|alt.badge.img+5
  • Contributor
  • January 23, 2025

Lists are a good idea too, check out this post.

 

 


bretr
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • January 23, 2025

This may work with the Tester, just going to confirm:

 

 

 

Just creating brand new Attributes on the Features to hold the values then nothing gets overwritten, then can remove all the extraneous attributes at the end.

 

Curious still if there is anything more elegant, but thanks ​@arenscott !

 

Cheers!

 

bret


arenscott
Contributor
Forum|alt.badge.img+5
  • Contributor
  • January 23, 2025

That looks pretty nice, good job! The Test filter might allow you to go from 3 Testers to one transformer.
I’m also curious if someone has a more elegant solution; I also have a similar work issue to yours!


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • Best Answer
  • January 23, 2025

An attribute exploder with an attribute manager to tidy things up should work here

 

 


bretr
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • January 23, 2025

I really like this option, thanks ​@ebygomm 

I will build out the workspace using this method.

Cheers!


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