Skip to main content

I need something like this: if the value is NULL or non-existent, then name field as "UNKNOW", else where bring the values assigned to it.

How can I tell FME to separate the NULL and empty cells from the numbered ones?

For example:

feature 1 has attribute ‘someattr’ == blank, then attribute ‘someoutput’ = UNKNOW

feature 2 has attribute ‘someattr’ with a value, then attribute ‘someoutput’ = the value from ‘someattr’ attribute

See this workspace for an example:

attributevaluemapper.fmw

Screenshot:


Have a look at the NullAttributeMapper. That transformer seems to fit the description.

NullAttributeMapper


The AttributeManager can also be used for this if else kind of statements and the attribute mapping.


See this workspace for an example:

attributevaluemapper.fmw

Screenshot:

Here is a screenshot showing settings to update a TYPE attribute. In this case the source TYPE attribute has some single space values ' ', which need to be replaced with text 'UNKNOW'.

 

 

https://www.dropbox.com/s/izo4hin9o1c0hz2/Screenshot%202016-11-08%2000.15.30.png?dl=0

 


The AttributeManager can also be used for this if else kind of statements and the attribute mapping.

That's what I was thinking. Set it up to create 'someoutput' using the conditional option, with the condition being the value of 'someattr'

 

 


Have a look at the NullAttributeMapper. That transformer seems to fit the description.

NullAttributeMapper

Reading the question again: First copy 'someattr' in 'someoutput' and then use the NullAttributeMapper on 'someoutput'.

 

 


if the attribute exists u can also simply use a creator for this.

@SomeAttr == ""?"Empty":@SomeAttr

if misses or Null it results in a missing operand error.


Reply