Skip to main content
Solved

multiplication for all the value if with the same name

  • August 21, 2024
  • 9 replies
  • 138 views

chaoluo
Contributor
Forum|alt.badge.img+1

Hi there, Anyone could help? I would like to build a FME workbench to run a multiplication for all the value if they are belongs to the same name. Attached a sample data e.g. I want to get the multiplication for armstrong_2006( 42*10*39*26), then I want the result to be added back in this spreadsheet. thanks.

 

Best answer by dustin

Use an Aggregator with the following settings:

  • Group by: ‘name’ field
  • Attributes to Concatenate: ‘value’ field
  • Separator Character: *

In an AttributeCreator, create a ‘result’ field with the expression @Evaluate(@Value(value)). This will multiply the value because we used * as the separator.

Finally, use a FeatureMerger with Requestor and Supplier both set to the ‘name’ field.

 

 

Hi Dustin, can I have a similar question to this? if the value are texts (A,B,C) how do I combine them into 1 row with separator of “,”? thanks

Use a comma as the Separator Character in the Aggregator, then in the AttributeCreator instead of @Evaluate(@Value(value)), use @Value(value).

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

9 replies

mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • August 21, 2024

Try the Aggregator transformer. Group-by on the name and use the Attribute to Sum parameter to pick the data field. The output will be one record per name with the sum of the values.


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • August 21, 2024

Use an Aggregator with the following settings:

  • Group by: ‘name’ field
  • Attributes to Concatenate: ‘value’ field
  • Separator Character: *

In an AttributeCreator, create a ‘result’ field with the expression @Evaluate(@Value(value)). This will multiply the value because we used * as the separator.

Finally, use a FeatureMerger with Requestor and Supplier both set to the ‘name’ field.

 


mark2atsafe
Safer
Forum|alt.badge.img+59
  • Safer
  • August 21, 2024

Try the Aggregator transformer. Group-by on the name and use the Attribute to Sum parameter to pick the data field. The output will be one record per name with the sum of the values.

Sorry. You wanted multiplying, not addition. My bad.


chaoluo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 21, 2024

Dustin, excellent.👍 I tried the workflow that you provided, it worked for me very well. Much appreciated. 


chaoluo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 21, 2024

Try the Aggregator transformer. Group-by on the name and use the Attribute to Sum parameter to pick the data field. The output will be one record per name with the sum of the values.

Sorry. You wanted multiplying, not addition. My bad.

no problem at all. thanks for your answer as well. 


chaoluo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 21, 2024

Try the Aggregator transformer. Group-by on the name and use the Attribute to Sum parameter to pick the data field. The output will be one record per name with the sum of the values.

Sorry. You wanted multiplying, not addition. My bad.

Dustin, excellent.👍 I tried the workflow that you provided, it worked for me very well. Much appreciated. 


chaoluo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 21, 2024

Use an Aggregator with the following settings:

  • Group by: ‘name’ field
  • Attributes to Concatenate: ‘value’ field
  • Separator Character: *

In an AttributeCreator, create a ‘result’ field with the expression @Evaluate(@Value(value)). This will multiply the value because we used * as the separator.

Finally, use a FeatureMerger with Requestor and Supplier both set to the ‘name’ field.

 

 


chaoluo
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 21, 2024

Use an Aggregator with the following settings:

  • Group by: ‘name’ field
  • Attributes to Concatenate: ‘value’ field
  • Separator Character: *

In an AttributeCreator, create a ‘result’ field with the expression @Evaluate(@Value(value)). This will multiply the value because we used * as the separator.

Finally, use a FeatureMerger with Requestor and Supplier both set to the ‘name’ field.

 

 

Hi Dustin, can I have a similar question to this? if the value are texts (A,B,C) how do I combine them into 1 row with separator of “,”? thanks


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • August 21, 2024

Use an Aggregator with the following settings:

  • Group by: ‘name’ field
  • Attributes to Concatenate: ‘value’ field
  • Separator Character: *

In an AttributeCreator, create a ‘result’ field with the expression @Evaluate(@Value(value)). This will multiply the value because we used * as the separator.

Finally, use a FeatureMerger with Requestor and Supplier both set to the ‘name’ field.

 

 

Hi Dustin, can I have a similar question to this? if the value are texts (A,B,C) how do I combine them into 1 row with separator of “,”? thanks

Use a comma as the Separator Character in the Aggregator, then in the AttributeCreator instead of @Evaluate(@Value(value)), use @Value(value).