Skip to main content
Solved

multiplication for all the value if with the same name


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

chaoluo wrote:
chaoluo wrote:
dustin wrote:

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).

View original
Did this help you find an answer to your question?

9 replies

mark2atsafe
Safer
Forum|alt.badge.img+43
  • 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+30
  • 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+43
  • Safer
  • August 21, 2024
mark2atsafe wrote:

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
mark2atsafe wrote:
mark2atsafe wrote:

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
mark2atsafe wrote:
mark2atsafe wrote:

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
dustin wrote:

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
chaoluo wrote:
dustin wrote:

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+30
  • Influencer
  • Best Answer
  • August 21, 2024
chaoluo wrote:
chaoluo wrote:
dustin wrote:

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).


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings