Question

BulkAttributeRenamer - Not renaming


Badge +2

FME(R) 2020.1.0.0 (20200305 - Build 20510 - WIN64)

 

When using the BulkAttributeRenamer with a variable prefix. The prefix doesn't get added on the attribute but shows in the inspector.

 

 

Any thoughts?


2 replies

Badge +3

Renaming with a variable instead of a fixed string value would be expected to create an Unexposed Attribute, since WorkBench cannot possibly automatically know what the value of the prefix will be at design time.

So the Workflow appears to behave normally, with "Bridgewatch_sell_price_max" and "Bridgewatch_sell_price_min" being Attributes on the Features, but just unexposed Attributes.

The difference between the Data Inspector Table View and the Feature Information View is that Table View by default only shows Exposed Attributes, whereas the Feature Information panel shows all attribution stored against that Feature inside the Partial Run/Inspector output file(s).

What is curious is why the original Attribute Names stay exposed on the Table View, but that makes some sense in that it would pick up Features where the String Prefix value evaluated to Null or a Zero length string. In the case of the Feature selected in the screenshot, the Attributes are "Missing" ie. Don't exist on the selected feature, which is again expected since they got renamed to a variable expression.

What functionality is being sought by breaking up the Attributes into ones becoming separately named by City? If it is for Cross-tabbing, there are potentially better ways.

Userlevel 4
Badge +26

Yes, as @bwn notes, because the prefix comes from an attribute, this is a dynamic scenario, where the schema isn't known until run time. In fact, it's not known until it reaches the renamer and discovers the value of the City attribute.

FME will make the change at run time, but you won't see it in the table view, because that's showing the known schema, not the dynamic one.

All of that to say, this means you need a dynamic schema on the writer too, if you want to write those fields. Generally you would need to create an attribute-based schema: you'd add an attribute like attribute{0}.name = @Value(City)_sell_price_max etc etc. See this article.

Either that or - if you knew the cities in advance - you could perhaps create those schemas in an Excel spreadsheet and read that into the workspace (as a resource reader).

I hope this is of use.

Reply