Have to make a 0 values in table null

2400
8
04-08-2015 11:42 AM
Highlighted
New Contributor II

I have a shapefile with PID readings attached for each location. I would like to make all 0 values null. I have found a few sources pointing me in the right direction and to use the field calculator. My experience with VB script and python is minimal. Does anyone know what the formula would be? I would assume I would have to use the "replace" command, but not positive.

Reply
0 Kudos
8 Replies
Highlighted
Frequent Contributor

Just select by attribute, where the PID values = 0, and then right click the PID field  --> field calculator, enter the word NULL into the box, and hit ok.

Highlighted
MVP Regular Contributor

Casey,

If you are using the Field Calculator in ArcMap, you can select the records = to 0 and just calculate the value to NULL

For instance:

Regards,

Tom

Highlighted
MVP Esteemed Contributor

Python  uses None for the null value:

Reply
0 Kudos
Highlighted
Frequent Contributor

There's really no need to use python though, he could just use the default VB script.

Highlighted
MVP Esteemed Contributor

True; but since its 2015, there's more than one way to skin a cat......

Highlighted
Esri Esteemed Contributor

Except that the data format is shapefile, and dBase doesn't support numeric nulls, so the cat gets off lightly this time.

- V

Highlighted
MVP Esteemed Contributor

Seems like people use the word shapefile just like Kleenex and BandAids, even though they are really using Puffs & NexCares.....

Highlighted
Esri Esteemed Contributor

I hear you.  If the shapefile is a "FGDB shapefile" or "shapefile in SDE", then the options for field calculation are improved.

- V

Reply
0 Kudos