Skip to main content

Good day!

I'd like to change data structure from as shown on 1st

picture to structure as shown on 2nd picture.

Simply stated i want values replace from first column (Attributes) to attribute name values and second column should be values for these attributes. I think Attributes field on 1st picture will not be stable. Elements will change from time to time.

This is a subtotal result from big WB processing result...

I tried to use AttributeCreator, but result is not good(.

How can i do this?

Thanks)

Use AttributeCreator with AttributeName set to @Value(Attribute) and Value set to Value


Use AttributeCreator with AttributeName set to @Value(Attribute) and Value set to Value

It does not work...I tried to do how you said, but nothing changes.

Also, I saved the result as xls file and tried to do this again...nothing.


It does not work...I tried to do how you said, but nothing changes.

Also, I saved the result as xls file and tried to do this again...nothing.

Hi @sega, I think the AttributeCreator should work, but the new attribute names will not be exposed automatically on the Workbench interface. Check the result with the Logger or the Feature Information pane of FME Data Inspector. You can expose the attribute names manually with the AttributeExposer optionally.


Hi @sega, I think the AttributeCreator should work, but the new attribute names will not be exposed automatically on the Workbench interface. Check the result with the Logger or the Feature Information pane of FME Data Inspector. You can expose the attribute names manually with the AttributeExposer optionally.

Hello @takashi, yes, I did like you say. It works)

But what if attributes are not stable? It means...names and counts of attributes are changing. Today I have all attributes shown on this example and tomorrow i will get these attributes and one( two, three...) more (f.e. Vessel Type). If I will use AttributeCreator ---> AttributeExposer with predefined list of exposed attr, I will lose "Vessel Type"...

How to solve this situation "dynamically"?

Thanks!)


Hello @takashi, yes, I did like you say. It works)

But what if attributes are not stable? It means...names and counts of attributes are changing. Today I have all attributes shown on this example and tomorrow i will get these attributes and one( two, three...) more (f.e. Vessel Type). If I will use AttributeCreator ---> AttributeExposer with predefined list of exposed attr, I will lose "Vessel Type"...

How to solve this situation "dynamically"?

Thanks!)

If the schema (the number of attributes and their names etc.) may be vary, you will have to implement a work flow to create the schema based on the source data at run-time, and also apply the dynamic schema to the writer.

There are several ways and variations to do that, but It's hard to find an appropriate way based on the current limited information.

Firstly you need to learn about the Dynamic Workflow. I think this article would be a good starting point.

Tutorial: Dynamic Workflows


check out suggestions under dynamic attribute creation.


@takashi, @bruceharold thanks a lot for your suggestions


Reply