Skip to main content

Hi folks,

New to the forum and FME, I'm hoping I can leach some knowledge.

 

I have a csv file that imports into FME like this:

 

I would like to manipulate it into the following format:

 

Depending on which file is imported Costs 1, 2 & 3 may be there, or it may be a combination of 1 or 2 costs. All costs do share a common three characters at the left of their name. Is it possible to dynamically look at the cost columns and then transform the data into the format shown in the second pciture?

 

Thanks in advance.

 

Andrew

Looks like you are attempting to keep only costs greater than zero. If two or three costs in a single record are greater than zero, how do you need to transform the record?


Looks like you are attempting to keep only costs greater than zero. If two or three costs in a single record are greater than zero, how do you need to transform the record?

Hi takashi,

Thanks for the reply.

At present that case does not exist, but if it did I would like those costs to come through as two or three records with the relevant attributes included.


Hi @andrew.t, a possible way I can think of is: Branch the workflow into three streams for Cost1, 2, 3, create the new attributes Action and Amount on the streams, connect the streams to a single Tester and keep only the features having 0 < Amount, finally remove unnecessary attributes and re-order the attributes with the AttributeManager if necessary. See also the screenshot below.

Just be aware the value of Action should be a literal string which can be entered with the Text Editor, and the value of Amount should be assigned an attribute value from the original Cost1, 2, 3.

 

 


Hi @andrew.t, a possible way I can think of is: Branch the workflow into three streams for Cost1, 2, 3, create the new attributes Action and Amount on the streams, connect the streams to a single Tester and keep only the features having 0 < Amount, finally remove unnecessary attributes and re-order the attributes with the AttributeManager if necessary. See also the screenshot below.

Just be aware the value of Action should be a literal string which can be entered with the Text Editor, and the value of Amount should be assigned an attribute value from the original Cost1, 2, 3.

 

 

Oops, mistake. Please replace all "Amount" in my answer with "Quantity".


Hi @andrew.t, a possible way I can think of is: Branch the workflow into three streams for Cost1, 2, 3, create the new attributes Action and Amount on the streams, connect the streams to a single Tester and keep only the features having 0 < Amount, finally remove unnecessary attributes and re-order the attributes with the AttributeManager if necessary. See also the screenshot below.

Just be aware the value of Action should be a literal string which can be entered with the Text Editor, and the value of Amount should be assigned an attribute value from the original Cost1, 2, 3.

 

 

Thanks very much for the prompt assistance takashi.


Hi @andrew.t, a possible way I can think of is: Branch the workflow into three streams for Cost1, 2, 3, create the new attributes Action and Amount on the streams, connect the streams to a single Tester and keep only the features having 0 < Amount, finally remove unnecessary attributes and re-order the attributes with the AttributeManager if necessary. See also the screenshot below.

Just be aware the value of Action should be a literal string which can be entered with the Text Editor, and the value of Amount should be assigned an attribute value from the original Cost1, 2, 3.

 

 

Alternatively the ListPopulator could also help you.


Reply