Skip to main content

Dear community,

I just started with FME. I have an excel document with contains multiple columns. One column is called ‘Land Cover’. Depending on the values of 'Land Cover', I want to fill another column called 'classname' with new string values (‘Onkruid’ or ‘Gras’). The main idea is shown in the attached figure. I was trying to get this working with String Replacer or String Searcher. However, I did not manage. Could you help me out?

Kind regards, Lambertus

 

Take a look at the AttributeValueMapper, you can import your lookup table from your excel sheet


Take a look at the AttributeValueMapper, you can import your lookup table from your excel sheet

Hi @egomm, thanks for your reply. It sounds quite useful and suited for my job! I am going to try this one. It was thinking if you could also think about a solution using a Regular Expression within a String Replacer or another useful transformer?

 

Something like (in my own words):

when the string in attribute 'Land Cover' contains 'Grote_brandnetel' than write for the attribute 'classname' 'Onkruid'

when the string in attribute 'Land Cover' contains 'Gras' than write for the attribute 'classname' 'Gras'

when the string in attribute 'Land Cover' contains 'Ander, gras' than write for the attribute 'classname' 'Gras'


Hi @egomm, thanks for your reply. It sounds quite useful and suited for my job! I am going to try this one. It was thinking if you could also think about a solution using a Regular Expression within a String Replacer or another useful transformer?

 

Something like (in my own words):

when the string in attribute 'Land Cover' contains 'Grote_brandnetel' than write for the attribute 'classname' 'Onkruid'

when the string in attribute 'Land Cover' contains 'Gras' than write for the attribute 'classname' 'Gras'

when the string in attribute 'Land Cover' contains 'Ander, gras' than write for the attribute 'classname' 'Gras'

Yes, you could use a conditional value within an attribute creator/manager. Probably no need for regex in this scenario

If you already have the lookup table in excel though, the AttributeValueMapper is much easier to set up and manage

 


Yes, you could use a conditional value within an attribute creator/manager. Probably no need for regex in this scenario

If you already have the lookup table in excel though, the AttributeValueMapper is much easier to set up and manage

 

Thanks! :)


Yes, you could use a conditional value within an attribute creator/manager. Probably no need for regex in this scenario

If you already have the lookup table in excel though, the AttributeValueMapper is much easier to set up and manage

 

It is not directly related to my original question but I want to do another thing as well.

My lookup table (I just showed a bit of the information in my screenshot) contains a field 'samplepoint'. For 'samplepoint'==57, I want to change values in 3 other fields in the same row as samplepoint 57.

In my own words: when samplepoint==57, value of field A will be 1, value of field B will become 2 and value of field C will become 3. This all has to happen in the same row.

I thought about the AttributeCreator, but that creates a new attribute. I want to update existing values based for one row.. Could you give advise in this? Thanks in advance!


It is not directly related to my original question but I want to do another thing as well.

My lookup table (I just showed a bit of the information in my screenshot) contains a field 'samplepoint'. For 'samplepoint'==57, I want to change values in 3 other fields in the same row as samplepoint 57.

In my own words: when samplepoint==57, value of field A will be 1, value of field B will become 2 and value of field C will become 3. This all has to happen in the same row.

I thought about the AttributeCreator, but that creates a new attribute. I want to update existing values based for one row.. Could you give advise in this? Thanks in advance!

The attributecreator despite it's name will just update attribute values if the attribute already exists

Reply