Skip to main content
Question

How to populate a field with a value from a specific field identified in another field


dvanriel
Contributor
Forum|alt.badge.img+8

I am trying to populate a new field with a value from another field. It is not a simple attribute copy. Each record is getting the value from a different field that is specified in another field.

For example: I have the table below and I want to populate NEW_FIELD with one of the values of fields FIELD1 through FIELD4 based on what is provided in FIELD_TO_USE. This has to be dynamic (no hard coded TestFilter as I am doing that now).

FIELD1FIELD2FIELD3FIELD4FIELD_TO_USENEW_FIELD1234FIELD115678FIELD26ABCDFIELD3CEFGHFIELD4H

4 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • May 11, 2018

AttributeCreator with:

New attribute NEW_FIELD

Value @Value(@Value(FIELD_TO_USE))


takashi
Supporter
  • May 11, 2018

Alternatively, the AttributeDereferencer could also be used here.


dvanriel
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • May 14, 2018
erik_jan wrote:

AttributeCreator with:

New attribute NEW_FIELD

Value @Value(@Value(FIELD_TO_USE))

Thanks Erik!

 

 


dvanriel
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • May 14, 2018
takashi wrote:

Alternatively, the AttributeDereferencer could also be used here.

Thanks Takashi. I don't know which method I will use. They are both one transformer.

 

 

It feels like I learn a new transformer every week.

 

 


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