Skip to main content
Question

Create Attribute and Populate values from table

  • May 10, 2017
  • 6 replies
  • 56 views

venu
Contributor
Forum|alt.badge.img+5

I have a table information and that needs to be transpose like shown below screen shot.

Parcel number is more then 1000 and each parcel bldg type up 30 plus types.

Please can advise to achieve this task.

Thanks in advance

Venu

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

takashi
Celebrity
  • May 10, 2017

Hi @venu, a well known method is

  1. AttributeCreator: create a new attribute, name = the value of Bldg_Type, value = the value of Count (see the screenshot below),
  2. Aggregator (Accumulation Mode: Merge Incoming Attributes): aggregate the features grouping by the Parcel_No,
  3. AttributeExposer: and then expose the new attribute names (Villa, Residential Apartment, etc.), optionally

[Addition] The BulkAttributeRenamer (Action: Regular Expression Replace) can also be used instead of the AttributeCreator above.


venu
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 28, 2017

Hi @venu, a well known method is

  1. AttributeCreator: create a new attribute, name = the value of Bldg_Type, value = the value of Count (see the screenshot below),
  2. Aggregator (Accumulation Mode: Merge Incoming Attributes): aggregate the features grouping by the Parcel_No,
  3. AttributeExposer: and then expose the new attribute names (Villa, Residential Apartment, etc.), optionally

[Addition] The BulkAttributeRenamer (Action: Regular Expression Replace) can also be used instead of the AttributeCreator above.

any other solution or if any python code

takashi
Celebrity
  • September 28, 2017
any other solution or if any python code
In the case, the AttributeCreator (or BulkAttributeRenamer) + Aggregator (+ AttributeExposer) is a well-known solution. Is there any reason for asking other solutions? Just curious?

 


venu
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • September 30, 2017
In the case, the AttributeCreator (or BulkAttributeRenamer) + Aggregator (+ AttributeExposer) is a well-known solution. Is there any reason for asking other solutions? Just curious?

 

@takashi, thanks for your answer and reply.. I am not able to achieve what I want because in writer those bld_types fields need to be added manually and that bldg_type values will change it's not standard.

 

Maybe I am confused with your solution that's why I asked python code.Can suggest the easiest way to achieve the task.

 

 

 


takashi
Celebrity
  • September 30, 2017
any other solution or if any python code
Hi @venu, if the building types could change and you want to configure the destination schema automatically depending on the contents of the source dataset for each run, there is no easy way unfortunately.

 

A possible approach would be to create a schema feature based on the source data with a Python script and configure Dynamic Schema from the schema feature.

 

However, it's hard to fully explain all of them here. If you could post a sample source data, I would provide a demo workspace using the data.

 

Are you using FME 2017.0 or FME 2017.1?

 


takashi
Celebrity
  • September 30, 2017
any other solution or if any python code
If I understand your requirement correctly, the attached workspaces would work as expected. Both are created with FME 2017.1.

 

See also here to learn about the fundamentals.

 

Dynamic Workflows: Destination Schema is Derived from a Schema Feature