Skip to main content
Solved

FME Desktop 2022: “AttributeCreator” fails to copy a field into another using the arithmetic editor,

  • March 10, 2022
  • 7 replies
  • 40 views

jamal
Forum|alt.badge.img+5

FME Desktop 2022: “AttributeCreator” fails to copy a field into another using the arithmetic editor,

 

In the screenshot below, I wanted to copy the “fme_text_string” field to the “F1” but appears not work except for the first record.

 

What could be the issue here?

 

The data and workbench are attached

 

 

 

Clip_227 

 

Best answer by dustin

Try using this expression into the AttributeValue.

 

@Evaluate((@ReplaceString(@Value(F1),",","")*2))

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.

7 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 629 replies
  • March 10, 2022

You shouldn't need an arithmetic calculation if you aren't making any changes to the fme_text_string value. Simply make the Attribute Value in the AttributeCreator = fme_text_string.

 

You can also do without the TestFilter by using the Conditional Values function in the AttributeCreator.


jamal
Forum|alt.badge.img+5
  • Author
  • 342 replies
  • March 10, 2022

Thank you for the help.

 

I never figure it out why it fails when using arithmetic editor

 

 

Clip_230


jamal
Forum|alt.badge.img+5
  • Author
  • 342 replies
  • March 10, 2022

 

The issue is replicated as I wanted to multiply “F1” field with 2, for example. It just multiplies the first record and fails for other.

 

What could be the issue here?

 

Clip_231 


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • 629 replies
  • Best Answer
  • March 10, 2022

Try using this expression into the AttributeValue.

 

@Evaluate((@ReplaceString(@Value(F1),",","")*2))


jamal
Forum|alt.badge.img+5
  • Author
  • 342 replies
  • March 10, 2022

It works fine. However, as I applied it to another field, it fails as per the second screenshot

 

Is this code generic?

 

 

Clip_236 

Clip_237 

 

 

 

 

 


DanAtSafe
Safer
Forum|alt.badge.img+19
  • Safer
  • 345 replies
  • March 11, 2022

The code is generic for any attribute where you want to remove commas. But to remove "%", convert the number to its true value, and multiply by 2, try

@Evaluate((@ReplaceString(@Value(Percent_Legend),"%","")*0.02))

 


jamal
Forum|alt.badge.img+5
  • Author
  • 342 replies
  • March 11, 2022

Thank you very much for the help. It works fine

 

 

Clip_238