Question

Filter by attribute names

  • 10 October 2016
  • 6 replies
  • 29 views

Badge

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

Badge +16

A test filter based on regx might work for you

Badge

A test filter based on regx might work for you

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

 

 

Userlevel 2
Badge +17

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'.

Badge +16
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.

 

Badge +2

@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

Badge +1

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

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

Reply