Field calculators (available in QGIS, ArcGIS Desktop, etc) can recalculate the values of a single field on all, or selected, records within a table using an expression.

learn more… | top users | synonyms (1)

2
votes
1answer
17 views

How to auto increment a field based on groups within a feature class

I am needing to auto increment a field based on groups within a feature class. I have 8 plots within a given polygon and I need to assign them an ID from 1-8 for each set of plots within each polygon. ...
0
votes
3answers
37 views

Using if else syntax in field calculator with Python?

I want to calculate a field in the field calculator that are dependent on the values in 4 other columns. My columns are "A", "B", "C" and "D" Now I want to fill the column "X" with: if "A" and "B" ...
0
votes
3answers
33 views

Volume using VB Script of the field calculator

I am trying to compute the volume of the area given certain condition. i wrote the following VB code however, i am getting error that it has failed to do so. Can anyone look into it and suggest a way ...
0
votes
1answer
33 views

How do I make a field of summarized zip codes, 1 for each, put it into my data table and join the table to shapefile without losing data?

I'm trying to use a field in my shapefile with summarized zip code data. I have a table of hospital admissions data and in this table there is a field of zip codes which are repeated multiple times. ...
2
votes
2answers
4k views

Replacing NULL value with Zero in geodatabase table using Python parser of ArcGIS field calculator?

I am having some difficulties to change "NULL" values to zero in geodatabase. I have tried the following python code in ArcGIS 10.1 ("Field Calculator") to change it but did not work. Pre-Logic ...
2
votes
1answer
50 views

Python to create new fields in many layers / QGIS

I have a number of line layers on which I need to perform the same task: add 4 columns with the start and end points of each line. The expressions that I use to do this are: $xat(0) $xat(-1) $yat(0) ...
3
votes
1answer
41 views

An equivalent for field statistics for records

I know how to obtain various statistics for a field, or "column", in an attribute table in ArcGIS. Is there any way to obtain a Mode figure for records, or the "rows" in a table? For instance, an ...
4
votes
0answers
25 views

How to undo field calculation in ArcGIS Pro

I am using ArcGIS Pro and cannot find a way to undo field calculations. With ArcGIS, field calculations could be undone when an edit session was active, but Pro seems to be in a perpetual edit ...
1
vote
1answer
30 views

ArcGIS Calculate Field, Python Shape Expression

Using ArcGIS 10.1 and Python 2.7- I am trying to write an expression that calculates the mid point of a line. I've tried many different expressions, but I continue to get syntax errors. #An example ...
0
votes
0answers
11 views

How to accommodate hyperlinks that have a changing date?

I have an installation with close to 400 building, when I click the identify tool in ArcMap 10.3 I would like to be able to select a hyperlink that takes me to a floor plan PDF. All the floor plans ...
3
votes
1answer
36 views

Using ArcGIS Field Calulator with VB Script

My code looks like the following: if [LWS50yrp] <136.5 then [DMG_50y] = 0.1 elseif [LWS50yrp] >=136.5<154 then [DMG_50y] = 0.15 elseif [LWS50yrp] >=154<166 then ......
8
votes
2answers
2k views

Calculating Date Field with today's date from datetime.date.today()?

I'm working on part of tool that will use arcpy.CalculateField_management to add the current date to the attribut table. I've wandered far and wide on the interwebs and can't seem to find the ...
3
votes
2answers
1k views

Field Calculator returning incorrect length and area values

I can get accurate lengths of line features and areas of polygon features using the "Measuring Tool" in a QGIS project. However, when I attempt to generate length or area data in Attribute Tables ...
7
votes
1answer
7k views

How to measure areas of features in OpenLayers plugin background maps correctly?

I can't figure out how to make areal calculations (eg. in km2). I have tried the 'field calculator', I have tried the 'measure area' function on the "attributes" toolbar, and i have tried fTools in ...
2
votes
3answers
224 views

How to use field calculator to change values from a,b,c etc. to 1,2,3 etc.?

I have a vector shp with a column with string values. How can I convert this to a column of integer values in another column but keep the categorization: e.g. from: col1,newcol2 A, A, B, A, C, to: ...
0
votes
1answer
51 views

Unable to calculate field correctly using ArcPy

I am attempted to calculate a field in a feature class ("Feat_Class_1", by using the count of selected features within another feature class ("Feat_Class_2") as a numerator, while using the value of a ...
4
votes
1answer
1k views

How to use QGIS field calculator in python?

I would like to use QGIS Field Calculator in Python to update the existing column based on certain conditions? How can I do this?
1
vote
2answers
44 views

Parse multiple field in field calculator using python

I'm trying to fill a blank field depending on the contents of three other fields using python in the field calculator. Sample code is something like: def getClass(Text1,Text2,Text3): if Text1 is ...
3
votes
2answers
113 views

How to extract part of string after '*', '~', '-' or '#'

I have strings like this: 234/1-1 3345#5 11/2~10 6754*15 It needed only rightmost part of string after '-', '#', '~'or '*' . I figured how to extract when there is only one sign for example '~' ...
2
votes
1answer
272 views

Syntax for ArcGIS ICalculator object?

I have a code snippet that I can't figure out: 'Define a calculator for NewArea field pCalculator = New Calculator With pCalculator .Cursor = pCursor .PreExpression = "Dim ...
1
vote
1answer
87 views

How to Edit Field using VBscript or Python in Attribute Table

I add a field called Name in attribute table in arcgis 10.1 but I can't edit this field. From this site, I have learned that this can be done by field calculator using VBscript or Python. As I have ...
1
vote
2answers
58 views

How do I calculate a field to be equal to another?

How can I calculate the StreetNames field to be equal to the values in the TEMP field in the below feature class attribute table? I am working in a file geodatabase in ArcMap version 10.1.
1
vote
1answer
524 views

qgis how to split a field into field1 and field2 - comma is separator

How to split a field into field1 and field2 - comma is separator in field? Tried to use field calculator
3
votes
3answers
716 views

Normalizing values in single Field (from table) in ArcGIS for Desktop?

First of all, this is my first post, and I would like to appreciate all the useful information I have found so far on this site. Second of all, I have encountered a problem, in Field Calculator. ...
0
votes
1answer
28 views

Calculate Acos in ArcMap

I am trying to calculate acos in ArcMap (shp) using Python. Here is the code: arcpy.CalculateField_management(fc_Arcs, "Angle", math.acos(0.88), "PYTHON_9.3") If I set the value i.e. 0.88 I am ...
1
vote
1answer
18 views

How to calculate specific rows in layer field- ArcGIS 10.3

I try to calculate specific rows (OBJECTID 23-29) in "field_name" field with field calculator- i try to fill in the value "rt8". This is the attribute table: but i can't find any option to ...
2
votes
1answer
123 views

Calculating angle between polyline segments and assign this value to point?

I have a polyline feature with many segments (polyline split at vertices). I plan to record angle values to attribute table per each polyline segment and assign it to point features. I need to ...
0
votes
1answer
82 views

How to use QGIS field calculator to delete style code?

I am struggling with following issue: How to delete style code before id codes x.x.xx.. and the }s in the end? Examples below: {\fArial|b1|i0|c0|p34;A.B.11} {\fArial|b1|i0|c0|p34;A.C.1}
3
votes
1answer
52 views

ArcGIS Field Editor if/else syntax with python

I am just starting with Python and ArcGIs so here is my question: I have the column "DB_Low" (Type "Long") and want to fill a new column by changing values. The new column will be a Float-Type field. ...
1
vote
1answer
33 views

Using Field Calculator to assign consecutive numbers to a field based on attributes in another field

I am trying to assign consecutive numbers to a numbers field using Field Calculator so that all my 500 features have unique label values, however some features have multiple polygons and therefore ...
4
votes
0answers
84 views

Raster calculator creates strange output

I am trying to combine two raster layers (one is nighttime satellite data, the other is the GPW population density data). I am using raster calculator to combine the two (the following is for a ...
0
votes
0answers
23 views

Calculating and replacing Nulls with String In same filed using ArcMap Field Calculator?

I have a FC contain a field that has 2 values, Null and String (String values have been repeated and all have similar Name, i.e. 'Saturday'). I would like to use the Field Calculator to recalculate ...
1
vote
1answer
19 views

XY_LINK field using Point_X & Point_Y Fields

In the below image, I am trying calculate my XY_LINK field to return the values from Point_X and Point_Y field. Example of final result: {2474785.499662}{376075.063004} My code is as follows: ...
3
votes
1answer
38 views

Adding certain number for each community with QGIS field calculator?

I have a big data with the parcel numbers of different communities. Now I want to join the parcel numbers of the attribute list with an excel table. Since they need to have something in common to ...
11
votes
1answer
194 views

QGIS, Populate field with self-updating formula (like spreadsheet)

Is there any way (plugin, or otherwise) to put a formula as the value of a field, which would then self-update as the other fields it is based on are adjusted? Exactly the way field-calculator updates ...
0
votes
1answer
47 views

ArcGIS - if clause in the field editor with python

I have 2 columns in my table. "dB1" and "dB2" Now I want to calculate a third columnn "dB3" depending of the entries in column "dB1" and "dB2" if "dB1" or "dB2" have an entry of "0" I want to ...
4
votes
3answers
243 views

How do I say “use the value from the same row” in Field Calculator?

I have an attributetable with several columns. I want to change the values of column1 if they are NULL with the values of the same row in column5. case WHEN column1 is NULL THEN END How do I say "...
1
vote
1answer
543 views

Join and Calculate vb.net

I'm trying to join an excel table to a shapefile and then calculating those fields using vb.net. The code I have written has no errors, but won't work when I try it in ArcGIS 10.1 and I'm out of ideas....
1
vote
3answers
108 views

Replace occasional Space with Underscore using Python parser of ArcGIS Field Calculator?

I am creating a model which will give me two string values, one which reads exactly what is in a field and another which automatically replaces any Space with an "_". I have used Calculate Value tool, ...
3
votes
2answers
45 views

Tiny difference of calculated area of polygons

I have a shapefile of about 62.000 polygons. I calculate the area of each polygon on a field, named AREA1, with Calculate Geometry option. Secondly, I create a new field field named AREA2. I calculate ...
1
vote
1answer
35 views

Arcpy Freezing on Field Calculation

I am trying to populate a grid with the number of features in each grid cell. I've gotten this script to work with a subset of the data, but when I try to run it on the full (52,000+) cell feature ...
3
votes
1answer
69 views

Replace non-ASCII characters in QGIS Field Calculator

I want to replace all non-standard characters from fields in a dbf table in QGIS. From http://stackoverflow.com/questions/20078816/replace-non-ascii-characters-with-a-single-space I see we can use ...
9
votes
1answer
5k views

How to fill my column with consecutive numbers

I'm very new to QGIS, so forgive this simple question. Searching in older topics didn't help either. So: I make a new column in my attribute table and it has a default value (for example 0). I want ...
1
vote
2answers
928 views

Counting Characters using Field Calculator - Arcmap

I am trying to use field calculator to populate a column based on the the number of characters in another column. I am using the Python Parser. I am not sure if the .count() function is appropriate in ...
1
vote
2answers
33 views

Calculate text field using python script and keeping preceding zeroes

I'm trying to calculate records in a text field to "01", keeping the preceding zero in tact using python script in ArcGis. I can do this easily using the field calculator in ArcMap or the calculate ...
2
votes
1answer
46 views

field map string values in one field to domain field

Is there a method in ArcGIS 10.3.1 to calculate coded value domains in a domain field based on a string field source? Please see image. The solution appears to be to use the CalculateField GP in ...
1
vote
0answers
23 views

Creating a new field based on another field and proximity to another shapefile? [closed]

I have a shapefile (sf1) with speed and another shapefile (sf2) with road locations. I'm trying to create a new field in sf1 that denotes commuting, so a binary 0=not commuting;1=commuting. I created ...
3
votes
2answers
401 views

Extract string between special characters - and / into a new field ArcGIS Field Calculator

Can I create a field calc expression in ArcGIS 10.3 to print a selection between special characters? I would like to extract a selection of string from field [FolderPath] to a new field [Name]. The ...
10
votes
1answer
12k views

How to perform If Statement in Field Calculator of ArcGIS for Desktop?

I have a shapefile containing two numeric fields ("Dist_1" and "Dist_2"). I want a Field Calculation that will populate an additional field ("Result") with one of three answers: First if Dist_1 is ...