Skip to main content
Solved

Create a column with values from another column

  • March 23, 2021
  • 4 replies
  • 263 views

salvaleonrp
Enthusiast
Forum|alt.badge.img+20

Looking for a single transformer solution on this question. I have an ordered list and I'd like to populate Col 2 (group) with values from Col 1 that start with '# '. Since the number of rows for each group is random and the categories are also dynamic I'd like to avoid hard coding the groups as conditional values.

Best answer by ebygomm

You should be able to use adjacent attribute mapping in an attribute creator. Use a conditional statement to set the value of column 2 to equal column 1 if it begins with #, otherwise use the value from the previous features column 2

Capture

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.

4 replies

ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • March 23, 2021

You should be able to use adjacent attribute mapping in an attribute creator. Use a conditional statement to set the value of column 2 to equal column 1 if it begins with #, otherwise use the value from the previous features column 2

Capture


salvaleonrp
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • March 23, 2021

You should be able to use adjacent attribute mapping in an attribute creator. Use a conditional statement to set the value of column 2 to equal column 1 if it begins with #, otherwise use the value from the previous features column 2

Capture

Is Col2 in your schema already or created before the AttributeCreator transformer?


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • March 23, 2021

Is Col2 in your schema already or created before the AttributeCreator transformer?

You don't technically have to create the blank column Col2 in advance to populate, but if you don't you'll get the correct result but a red cog on the transformer.

I think if you have FME 2020 you may be able to create it in the same attribute creator


salvaleonrp
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • March 23, 2021

Is Col2 in your schema already or created before the AttributeCreator transformer?

That explains it. I have to manually type the Col2 prior feature attribute because it does not show up on the attribute list even if I enabled Advanced Editing. I did get the red cog and the warming during translation but it ran with correct results. Thanks!