Skip to main content
Hi,

 

I want to assign value to attribute A based on the value of attribute B.

 

e.g.

 

attribute_A     attribute_B

 

   1                   type1

 

   1                   type1

 

   3                   type3

 

...9                   type9

 

  ....

 

 

I know the attributeValueAssigner can do the job. But I have to type all the unique source value (here the values in attribute 😎. Is there a way to query all the unique values of attribute B. And then assign related value to attribute A?
Hi,

 

 

If the requirement is to extract the digits part from the attribute_B, the StringSearcher with this setting might help you.

 

Search In: attribute_B

 

Regular Expression: \\d+

 

Matched Result Attribute: attribute_A

 

 

The regular expression "\\d+" matches with one or more consecutive digits, and the transformer assigns the matched part to the attribute specified in the "Matched Result Attribute" parameter.

 

 

Takashi

 

Thanks. But that's not what I need. My example just gives the wrong impression.Sorry for that.

 

I need for instance, type1 -> 133,  type2 -> 343, etc. Of course, after I can get the unique values from attribute B, I need to manually assign new values to those unique values. Then apply them to the attribute A of all the features.
I got it. I would use the DuplicateRemover to get unique values of the attribute_B, and write them into an external table. e.g. csv.

 

Edit the table manually to define corresponding values (A) for each value (B); and then, merge the A values read from the table to the source data with FeatureMerger or Joiner, using B value as the join key.

Reply