Question

Field names from field values

  • 6 February 2019
  • 1 reply
  • 18 views

Hi all,

Firstly I found this post: https://knowledge.safe.com/questions/5094/create-column-names-from-column-values.html

But it hasn't answered my question fully.

I have multiple shapefiles containing points. Each point has a VALUE field and a unique ID field which is the same across all the shapefiles.

The end goal is to create a spreadsheet with the unique ID field and a field name containing the date of each shapefile populated with the VALUE field. The name of the shapefile contains the date so I am using substring extractors and a concatenator to build the date.

I followed the guidance in the previous question and am using an attribute creator to create the date field and populating it in the same step

And an attribute exposer

However, when I run the workspace and the date field is not created properly

But it is contained within FME

I tried writing to a spreadsheet, but the output was the same as the data inspector table view. As in it didn't create the field 18/05/2017, but it did create a field called @Value(DATE) with no values.

I'm beginning to feel rather silly that I can't get this to work!

Thanks for any help.

Matthew


1 reply

Badge +10

You cannot use @Value(Date) in the attributeexposer. It needs to be the actual value e.g. 18/05/2017

This is of course where the difficulty lies, if you don't know what values you need to expose. There are ways to deal with this, especially if there is not requirement to 'see' these attributes in the workspace, only to write them to a spreadsheet, but it is not straightforward.

Reply