Skip to main content
Question

Create Attribute and Populate values from table


venu
Contributor
Forum|alt.badge.img+5
  • Contributor

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

6 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 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
takashi wrote:

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
Contributor
Forum|alt.badge.img+19
  • Contributor
  • September 28, 2017
venu wrote:
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
takashi wrote:
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
Contributor
Forum|alt.badge.img+19
  • Contributor
  • September 30, 2017
venu wrote:
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
Contributor
Forum|alt.badge.img+19
  • Contributor
  • September 30, 2017
venu wrote:
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

 

 


Reply


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