Skip to main content
Solved

AttributeValueMapper is not renaming values

  • June 14, 2023
  • 9 replies
  • 54 views

Forum|alt.badge.img

Greetings,

 

I am trying to replace values using the AttributeValueMapper, it is not replacing the attributes in the field

 

image 

I would appreciate any assistance to resolve this issue.

 

Best answer by clives_online

I finally managed to get the issue resolved using an AttributeFilter.

 

image

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

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3697 replies
  • June 14, 2023

Can you, as an interim measure, try writing out to a new attribute?

 

Did you import the input values or type them manually? If you did them manually, is there a chance of any trailing spaces or other special characters?


david_r
Celebrity
  • 8391 replies
  • June 14, 2023

Can you, as an interim measure, try writing out to a new attribute?

 

Did you import the input values or type them manually? If you did them manually, is there a chance of any trailing spaces or other special characters?

Agreed, it's probably a mismatch between the actual data and the configured input values. Note that the transformer is case sensitive.

You can also try inserting an AttributeTrimmer before the AttributeValueMapper to see if that helps. Perhaps also a StringCaseChanger to force upper case.


Forum|alt.badge.img
  • Author
  • 31 replies
  • June 14, 2023

Hi

Thanks for the reply.

 

I have a trimmer before the AttributeValueMapper.

I copied and pasted the Value as:

RASSAU

@value(RASSAU)

 

Neither has any impact on the output??

image


Forum|alt.badge.img
  • Author
  • 31 replies
  • June 14, 2023

I updated the Form.

 

imageNo values have been updated??

 


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3697 replies
  • June 14, 2023

Apparently I clicked wrong and some posts were deleted, my bad

 

imageGo back to this situation, remove the first line (SITENAME and SITENAME) because it's referring to attributes rather than attribute values. Change the output attribute name to NEW_SITENAME, then run it.

 

If you don't see the values you expect in NEW_SITENAME it's because your input values don't appear in your SITENAME attribute, simple as that.

 

The AttributeValueMapper works as a lookup table: it looks in the input attribute for a value that appears in the input value column and if it finds one it puts the corresponding output value in the output attribute. If it doesn't find a match it'll put the default output value (or nothing if that's empty). Check this video where @mark2atsafe​ talks about the AttributeValueMapper to see how it's used.

 

Keep in mind it is, like pretty much everything in FME, case sensitive. So RASSU and Rassu are not the same.

 

Also keep in mind that any time you see a brown arrow it refers to an attribute rather than an attribute value, so that's why in that previous screenshot it simply mapped everything to the original value: that was on the first line so that's what it did (and that's why I want you to remove that first line).

 

Now, if you still don't see any matches: inspect your source data and make sure those values are in there.


Forum|alt.badge.img
  • Author
  • 31 replies
  • June 14, 2023

Is there an alternative transformer, this is not getting anywhere??

 

I created a new attribute NEW_SITENAME

imageimageimage


redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3697 replies
  • June 14, 2023

Is there an alternative transformer, this is not getting anywhere??

 

I created a new attribute NEW_SITENAME

imageimageimage

Last try, then I give up. Here's one I set up for one of my projects:

 

imageThis looks in the attribute FAC_TYPE for the values 4013 or 4100. If it finds them it will fill a new attribute, called TYPE, with the values NMBS Station and Metrostation respectively.


Forum|alt.badge.img
  • Author
  • 31 replies
  • June 14, 2023

I also tried BulkAttributeRenamer.

image 

Still no success??

image


Forum|alt.badge.img
  • Author
  • 31 replies
  • Best Answer
  • June 14, 2023

I finally managed to get the issue resolved using an AttributeFilter.

 

image