ArcGIS Pro 3.0.2: How to replace the records of “null” value with zero with a tool in model builder?
In the screenshot below, the “percent” field has records of “null” value. What could be the best way to replace these values with zero with a tool in model builder?
Solved! Go to Solution.
You already have a calculate field in your model.
Did the calculation incorporate checking for Null? If it did, you could assign a 0 value.
for example conceptually
if A is None, or B is None:
return 0
else:
return A/B * 100
I would feed that table into a select by attribute tool and select rows where Percent Is Null. The output of that tool is a table\featureclass with a selection, that simply feeds into a calculate field tool and you set it to zero. Remember all geoprocessing tools honour selections first, if nothing is selected then the whole dataset is processed.
You already have a calculate field in your model.
Did the calculation incorporate checking for Null? If it did, you could assign a 0 value.
for example conceptually
if A is None, or B is None:
return 0
else:
return A/B * 100
I wanted to replace the records of “null” value with zero BUT to keep the same number of records (which is 253 records) of the attribute table. How this can be performed optimally?
What is the expression that you used in "calculate field" ?