Skip to main content
Solved

How to apply attribute alias to all features using the existing attribute name


Forum|alt.badge.img

Using the AttributeManager, i understand that i could create a new attribute_alias for each attribute i want to update. However, since there are hundreds of attributes and they all need to be named the same as the existing attribute name - except in TitleCase without underscores > I wonder if there is an easy way to do this?

Best answer by nielsgerrits

nielsgerrits wrote:

I would try:

  • Select one row using a sampler.
  • Explode attributes into features.
  • Use a tester to remove the features where _attr_name starts with fme_
  • Create attributes from _attr_name.
    • Name: @Value(_attr_name)_alias
    • Value: @Value(_attr_name)
  • Expose created features using import from feature cache.
  • Remove _attr_name,_attr_value
  • Merge the features into one feature using the Aggregator.
  • Merge this single feature with all the _alias features to the original data using a FeatureMerger where 1=1.

 

Attached workspace demonstrating this.

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

3 replies

nielsgerrits
VIP

I would try:

  • Select one row using a sampler.
  • Explode attributes into features.
  • Use a tester to remove the features where _attr_name starts with fme_
  • Create attributes from _attr_name.
    • Name: @Value(_attr_name)_alias
    • Value: @Value(_attr_name)
  • Expose created features using import from feature cache.
  • Remove _attr_name,_attr_value
  • Merge the features into one feature using the Aggregator.
  • Merge this single feature with all the _alias features to the original data using a FeatureMerger where 1=1.

 


nielsgerrits
VIP
  • Best Answer
  • July 12, 2023
nielsgerrits wrote:

I would try:

  • Select one row using a sampler.
  • Explode attributes into features.
  • Use a tester to remove the features where _attr_name starts with fme_
  • Create attributes from _attr_name.
    • Name: @Value(_attr_name)_alias
    • Value: @Value(_attr_name)
  • Expose created features using import from feature cache.
  • Remove _attr_name,_attr_value
  • Merge the features into one feature using the Aggregator.
  • Merge this single feature with all the _alias features to the original data using a FeatureMerger where 1=1.

 

Attached workspace demonstrating this.


Forum|alt.badge.img
nielsgerrits wrote:

Attached workspace demonstrating this.

Thank you Niels that's really helpful


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