Solved

Create a column with values from another column

  • 23 March 2021
  • 4 replies
  • 46 views

Badge +10

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.

icon

Best answer by ebygomm 23 March 2021, 15:06

View original

4 replies

Userlevel 1
Badge +21

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

Badge +10

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?

Userlevel 1
Badge +21

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

Badge +10

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!

Reply