Skip to main content
Solved

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


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

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

7 replies

dustin
Influencer
Forum|alt.badge.img+30
  • Influencer
  • 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
  • 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
  • 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+30
  • Influencer
  • Best Answer
  • March 10, 2022

Try using this expression into the AttributeValue.

 

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


jamal
Forum|alt.badge.img+5
  • Author
  • 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+18
  • Safer
  • 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
  • March 11, 2022

Thank you very much for the help. It works fine

 

 

Clip_238 

 

 

 

 


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