Skip to main content
Solved

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

  • July 12, 2023
  • 3 replies
  • 26 views

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

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.

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.

3 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • July 12, 2023

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
Forum|alt.badge.img+60
  • 2938 replies
  • Best Answer
  • July 12, 2023

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

Attached workspace demonstrating this.

Thank you Niels that's really helpful