Skip to main content
Question

Filter by attribute names

  • October 10, 2016
  • 6 replies
  • 242 views

Forum|alt.badge.img

Hi,

Is it possible to sort features by attrbute name? Say I have Excel table with 10 columns, and I need three of them to go to first transformer, and the rest to go to another transformer. Column names are not constant. Or say they named by some order, like Group1tag, Group1kind and so on, how could I filter attributes by a mask 'Group1*'? Thanks,

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • October 10, 2016

A test filter based on regx might work for you


Forum|alt.badge.img
  • Author
  • October 11, 2016

A test filter based on regx might work for you

How exactly could I filter by attribute name, not its value?

 

 


takashi
Celebrity
  • October 11, 2016

Hi @crayxt, if you want to filter features depending on whether specific attributes exist or not, the 'Attribute is Missing' operator for Test Clauses in the Tester or TestFilter might help you. For example, the Tester with this setting routes the input feature to the Passed port if the feature doesn't have at least one of 'Group1tag' or 'Group1kind'.


itay
Supporter
Forum|alt.badge.img+18
  • Supporter
  • October 11, 2016
How exactly could I filter by attribute name, not its value?

 

 

You can use the attribute exploder and then test on the result, but if you are only interested in their existence, the option that @takashi refers too will work without exploding the attributes.

 


Forum|alt.badge.img+2
  • October 18, 2016

@crayxt The AttributeExploder will explode your feature (excel row) and give you a set of features as name/value pairs. You can then sort or filter these based on the <name> and then reaggregate. A little tedious for large datasets but should be OK for excel sized datasets


Forum|alt.badge.img+1

I have just added an idea for an 'AttributeNameFilter' transformer.

https://knowledge.safe.com/idea/69362/attribute-name-filter.html?