Skip to main content
Solved

Hi; I have a question related to the Attribute Manager transformer, "Substitute Missing, Null and Empty by" option.

  • November 7, 2023
  • 2 replies
  • 208 views

rzrnc
Contributor
Forum|alt.badge.img+2

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?

Best answer by takashi

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.

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.

2 replies

takashi
Celebrity
  • Best Answer
  • November 7, 2023

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.


rzrnc
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • November 7, 2023

Ok, thanks for the quick reply.

I understand now.