Skip to main content
Question

Filter by attribute names

  • October 10, 2016
  • 6 replies
  • 178 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,

6 replies

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

A test filter based on regx might work for you


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

A test filter based on regx might work for you

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

 

 


takashi
Influencer
  • 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+17
  • Supporter
  • October 11, 2016
crayxt wrote:
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?


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