Have to make a 0 values in table null

2852
8
04-08-2015 11:42 AM
caseybok
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.

0 Kudos
8 Replies
SepheFox
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.

TomSellsted
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

JoeBorgione
MVP Emeritus

Python  uses None for the null value:

That should just about do it....
0 Kudos
SepheFox
Frequent Contributor

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

JoeBorgione
MVP Emeritus

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

That should just about do it....
VinceAngelo
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

JoeBorgione
MVP Emeritus

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

That should just about do it....
VinceAngelo
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

0 Kudos