Skip to main content

My input attributes have numeric or string values, with possible empty string values.

I would like to replace empty string values with Null.

 

When I use the option "Substitute Missing, Null and Empty by: Default Value", and set "Default Value: <null>", nothing happens. The values remain unchanged (with empty string values).

 

I can get the desired result with the help of "Action:Set Value" and Value: Conditional Value -> If ATTRIBUTE IS EMPTY -> Value <null>".

 

I know I can use the Null Attribute Mapper transformer, and the Set Conditional Value method above, but using the

"Substitute Missing, Null and Empty by: Default Value" option seems the most elegant to me.

 

Have I misunderstood the purpose of "Substitute Missing, Null and Empty by: Default Value" or am I using it the wrong way?

Hi @rzrnc​ ,

The parameter setting determines what value FME considers a referenced value if it was missing, null, or empty.

For example, if an attribute called "a" was empty and you set null to substitution default value, referenced "a" value is considered as null when you assign "a" to a new attribute called "x". Result, the value of "x" will be null, but "a" is still empty. That is, the parameter setting won't change an attribute value directly.

I think using NullAttributeMapper is the most common approach in your case.

Hope this helps.


Ok, thanks for the quick reply.

I understand now.


Reply