Skip to main content

I have a table and I want to build another table from it, e. g.

values | types
12     | house
3      | car
4      | boat

to:

house | car | boat
12    | 3   |  4

This works with the AttributeCreator (Input: @Value(types) / values), if you check the output with a Logger. However I can't see or use the result in other transformers, unless I expose the fields with the AttributeExposer, which defeats the purpose of the dynamic creation. Is there any way around that? The content of the table changes, so exposing manually is not exactly desirable. There's a custom transformer, AttributeTransposer, but it also requires exposing afterwards.

You can't expose them on the workspace canvas, but it's not necessary to expose them in order to write them out to a new format.

Do you need them exposed on the canvas? Because if they need to be exposed on the canvas and then you explicitly reference them the workspace is no longer dynamic.

 

You can do some manipulation in a python caller without exposing


If you're looking to process some attributes without necessarily knowing the exact name, you can use the AttributeExploder. It will return one feature per attribute / value pair of each feature that enters. It's not super efficient however, since feature creation is relatively costly.

The most efficient solution is to use Python, is my experience, as you can loop over feature attributes without creating FME features on the way.

But as @ebygomm​ stated, if you're just looking to write out the attributes to a dynamic writer, it's not necessary to expose the attributes at all.


Reply