Skip to main content
Question

Create Identifier based on attribute value

  • Apr 30, 2015 2:45 PM UTC
  • 2 replies
  • 116 views

Forum|alt.badge.img
Dear FME community,

 

 

I have an attribute which contains several unique string combinations. For example:

 

attribute: number

 

values: "one", "two", "three", "four", "five"

 

 

I want to add a unique number (id) as a new attribute. Each attribute with the value "one" should become 1, each value "two" should become 2 and so on. If there are more than a single "one", then each one should have the new value 1.

 

 

I tried to solve this with the counter transformer with "Counter Name" set to the attribute "number", so that this attribute is the attribute to group by. But this one didn't work. It only works with the CRCCalculator, but then I don't get the simple id's that I want.

 

 

Any idea's on how to solve this issue? I simply want create a new column wich contains a number as a new identifier for the string attribute value.

 

 

Kind regards from Germany

 

Thomas

 

 
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.

2 replies

takashi
Celebrity
  • Apr 30, 2015 10:34 PM UTC
Hi Thomas, the AttributeValueMapper or the StringPairReplacer might help you.

 

Takashi

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • May 1, 2015 1:22 PM UTC
yes or use  [string map "one" 1 "two" 2 etc. ] in a attributecreator