Skip to main content

I am taking data from a shapefile and mashing it with a CSV, and the attribute I am having issue with has null, numbers and non-numeric characters/alphabetic values (from the input).

The target field in my output is an integer type (uint). I would like to make Null all attributes of that field that are non-numeric (some are purely alphabetic; others have characters like in a date format).

I was hoping to use an AttributeManager that I was already utilizing to perform this operation, but I don't know how (or what other transformer would be best).

I would use the AttributeValidator to check what records have a non integer value and then the AttributeSetter (will be the AttributeCreator) to set that value to Null.


Yes, the AttributeValidator is a possible way. Alternetively, you can also use conditional value setting in the AttributeManager or the AttributeCreator. e.g.

If attr Type Is Integer Then <No Action> Else <null>

However, with those methods, I'm afraid that the workspace or parameters setting could become too cluttered if there were multiple target attributes. So I would use the NullAttributeMapper to make the workspace concise.  Updated]

0684Q00000ArJSuQAN.png



Yes, the AttributeValidator is a possible way. Alternetively, you can also use conditional value setting in the AttributeManager or the AttributeCreator. e.g.

If attr Type Is Integer Then <No Action> Else <null>

However, with those methods, I'm afraid that the workspace or parameters setting could become too cluttered if there were multiple target attributes. So I would use the NullAttributeMapper to make the workspace concise.  Updated]

0684Q00000ArJSuQAN.png


Sorry, the regular expression was wrong. I've corrected the screenshot above.

 

 


Reply