Skip to main content
Question

Create Identifier based on attribute value


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

 

 

2 replies

takashi
Contributor
Forum|alt.badge.img+23
  • Contributor
  • April 30, 2015
Hi Thomas, the AttributeValueMapper or the StringPairReplacer might help you.

 

Takashi

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

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