Skip to main content
Question

Dynamically Keep/Remove attribute fields?


joshuadamron
Contributor
Forum|alt.badge.img+7

Is there a transformer that is a cross between an AttributeKeeper/Remover and a Tester? Meaning that I need to dynamically split my data not on attribute values but on the attribute field names, so all of the fields with the suffix '_alias' are routed one direction and all other fields are routed another.

Any thoughts on how I can achieve this?

3 replies

Forum|alt.badge.img+2

Hi @joshuadamron,

I'm not aware of a transformer that will allow you to test the Attribute Names rather than there values, as a workaround I would use the steps proposed by Mark in this post where he suggests first using an AttributeExploder. The output of this is attr_name and attr_value pairs so you can then use a Tester with the operation 'Ends With' _alias. Once sorted through the different output ports you can then aggregate the data back together.

 

Please also consider upvoting this idea: https://knowledge.safe.com/questions/35011/filter-by-attribute-names.html requesting support for a transformer that allows you to filter by attribute name.


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • July 3, 2019

You can use two bulk attribute removers - 1 to keep everything ending in _alias and one to keep everything not ending in _alias


joshuadamron
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • July 3, 2019
ebygomm wrote:

You can use two bulk attribute removers - 1 to keep everything ending in _alias and one to keep everything not ending in _alias

Thank you, exactly what I was looking for!


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