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)

4
votes
4answers
7k views

Why doesn't the Field Calculator work in ArcGis 10?

When I try to calculate a field nothing happens. I have always been able to just select the field, open the field calculator and type = and the new number. This is frustrating because the other GIS ...
3
votes
4answers
1k views

Field Calculator in ArcGIS - keep equation

I'm using Arc 9.3.1 (Arc Editor). In edit mode I've created a simple field calculation. For example's sake let's make it [Field3] = [Field1] + [Field2] How do I 'keep' the calculation so Field3 ...
4
votes
2answers
2k views

VBA functions use in ArcGIS Field Calculator

Would this be ok to use them for the field calculator in ArcGIS 9.3 ? See here MS Excel VBA Functions Or should I fix them in MS Excel and save as a file and then use the join with the shapefile or ...
0
votes
1answer
364 views

Error when using .isalnum in ArcGIS fieldcalculator

ArcGIS keeps throwing an error when I use the following script in the field calculator, using Python: pre-logic script code: y= () if !fieldx!.isalnum(): y= 1 else: y= 0 Fieldy= y The ...
2
votes
1answer
306 views

Field calculation in ArcGIS Desktop?

i have a data which contain a code of area an value of area in shapefile, ex.: area|value 1|33 1|43 1|31 2|12 2|43 3|66 3|76 the question is how to calculate total value per area with arcgis, i ...
5
votes
3answers
1k views

calculating a field in which null values may be present

I would like to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have null values for one or more of the fields. For example, ...
0
votes
1answer
13 views

How to use field calculator in QGIS to calculate new coordinates, and use that new columm to geolocate a layer's points

In a separate question, at How to shift a CRS by an observed offset, I asked about shifting a CRS to align the problems aligning data points with a satellite image obtained from OpenLayers. (They ...
3
votes
1answer
112 views

How to calculate the intersected area from a layer with overlapping buffers in qgis

I need to calculate the area of landusetypes in 50m around various dots (all in one shapfile). My problem is, the buffers around the dots are overlapping each over in some places. I tried to ...
1
vote
1answer
16 views

Add a certain number of days for a date field

I have one field for a permit decision date, and then I have another field for 180 days from that permit date. The permit date field has data entered, but the 180 day field I would like to calculate ...
0
votes
1answer
41 views

Field calculator (using ATAN)

How do I input the arc tan in the field calculator given the values of the fields to get the desired answer, I compare the answer of the manually computed arc tan value and the Atan Spatial Analyst ...
1
vote
0answers
31 views

Passing Value for Dictionary Look Up in Field Calculator fails [closed]

I've a field calculator that I am trying to use that uses a csv file to look up appropriate value based on key that is passed provided to the function. As provided below, the only values calculated ...
1
vote
0answers
26 views

Field Calculator stopped working

The field calculator seems to have stopped working for one of my attribute tables (it works fine on others). No matter what I get it to express (I've tried simply 2*2, just as a test) it just produces ...
0
votes
1answer
282 views

Join and Calculate vb.net

Im 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
1answer
43 views

Use value of Field in Calculation in Modelbilder

In Modelbuilder I have set up a model, where in one step I do a "Calculate Field" like "round((!OID!-1- %MyField% /15)/452,1)+1" . For the calculation i use the value of %MyField%, which actually is ...
3
votes
3answers
1k views

Calculating X and Y of line start and line end using ArcPy?

I have a series of polyline shapefiles and I am trying to automate the process of calculating the X and Y coordinates of the line start and line end using Python. I have added the 4 fields (startx, ...
2
votes
1answer
41 views

Subtracting columns (that include null values) in ArcMap Field Calculator

I’m desperately trying to run a very simple command where I subtract one column with others. However the problem is that some rows have NULL values, therefore the result of subtracting is also NULL. ...
2
votes
2answers
29 views

Add both string and automated numbers in series to attribute table using field calculator

I would like to fill a column in my attribute table with an string that ends in a numeric value. Example: Object001 Object002 Object003 I would like to automate the process of filling in the ...
4
votes
1answer
234 views

Cannot compute area of shapefile in field calculator of QGIS?

This shapefile represents the counties of NM. I am trying to compute the area of each polygon (yes, I know there is an area field, but this is a simpler example of a problem I'm having which doesn't ...
1
vote
1answer
154 views

Calculating values of field based on two others using Field Calculator in ArcGIS Desktop?

I need to combine two fields in an attribute table. I want to do this using the field calculator. What is the proper script to write to combine a field called "name" and "type", so that it produces ...
1
vote
1answer
42 views

how multiply a ranges of values for other value on python

I need multiply ranges>1.5 and <=4.5 * 9, but I am new in this type of language. please help me. def CalcD(Level_water) if Level>1.5 and <=4,5 * 9
1
vote
2answers
67 views

Using Python For a Field Calc

In AcrMap 10.2 I'm trying to add a field and run this script in Field Calc: !shape.isMultipart! to see if I have any multipart lines. I keep getting geoprocessing failures. I am clicking the ...
0
votes
0answers
26 views

How do I auto-populate more than one other attribute field with values based on the value of another field within the same record?

Based on value selection from one attribute field, would it be possible to auto-populate many fields within the same record with predefined values either from a range of values within another field or ...
4
votes
2answers
4k views

Nested “if” statements in ArcGIS Field Calculator

The solution in VB for the base process is @ "If then" VB Script code (or Python) equivalent to SQL's IN ('x','y',z') expression in ArcGIS Field Calculator question? ...
1
vote
2answers
41 views

basic problem using division in field calculator

This is a very basic question, but I can't figure out what's going on. I've got election results I'd like to simply display as percentages rather than vote totals, which should be as simple as ...
1
vote
0answers
15 views

Trying to export stacked text to CAD using ArcGIS 10.2

I've been experiencing some unwanted results when trying to export stacked text to CAD using ArcGIS 10.2 for desktop. With the Export to CAD tool I can easily export polygons. However, I'm also trying ...
1
vote
4answers
107 views

Calculate Field with Python Issues (If statements)

I don't know a whole lot about python and scripting, so I was hoping somebody could give me a couple pointers on fixing some code. I am trying to calculate a "final results" attribute field. The ...
1
vote
1answer
47 views

Join and Field Calculator

I made a Join between a shape and a dbf, and now I want to calculate some data from the table that came as a result from that Join. Everytime I try to run the Field Calculator it says there's an ...
3
votes
2answers
76 views

Iterate calculate field in multiple tables in ModelBuilder

I would like to iterate calculate field in multiple tables using ArcGIS Model Builder. The figure below explains details of the calculations. My existing model calculates value only for the first ...
4
votes
4answers
282 views

How to create a label formatted like “ 1,000' ” from a numeric field?

This question builds on a previous question I came across at gis.stackexchange: How to easily edit attribute data using Regular Expressions? Perhaps someone can point me in the right direction? I ...
3
votes
1answer
91 views

Using arcpy and script toolbox to add the date to a attribute table

I would like some information on how to add a date to an attribute table, by adding a user specified date in a script tool that will update the polygons attribute table. In short I have two polygons ...
0
votes
1answer
38 views

What is expression for finding perimeter in ArcPy and Field Calculator?

What is the correct format for finding perimeter as an expression for arcpy. I was able to use expression !shape.Area! to find the area of my polygon. However when I use the expression ...
1
vote
2answers
123 views

What's wrong with this VB Script code for the field calculator in ArcGIS 10?

I am trying to use one field's contents ([Condition]) as a condition for populating another field ([Intact]). I try to run the following code in the Field Calculator, but it never works (and is not ...
2
votes
1answer
77 views

ArcMap Python Question: Trying to Field Calculate Slope Percent in to Text

I have a layer of polygons that I spatially joined to a raster to point layer of slope percents. My polygons now have the percent of slope in a field called Avg_point. I want to use the field ...
3
votes
1answer
78 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
144 views

Syntax error from Python parser of ArcGIS field calculator if then?

Using ArcMap - I would like to calculate one field based on the value of another field. I want to Update the field 'Date_Class' based on the value in another field 'MIN_YEAR_B'. I was trying to do ...
1
vote
1answer
320 views

Calculating Stream Length-gradient Index (Hack Index) with the field calculator

I'm trying to calculate the Stream Length-Gradient Index of a stream (example data below). Just started to get into python, but am struggling with a solution to this problem. I have 42 streams to run ...
2
votes
1answer
1k views

Getting ValueError: max() arg is an empty sequence on a Python Script in the Field Calculator in ArcMap

I have a script that populates a FacilityID Field on a Attribute table in the Field Calculator but when I run the script below I am getting a error. EDIT: Python Script: def autoInc(): import ...
0
votes
1answer
40 views

Building heights above DEM through field calculator

I have a series of building polygons which I would like to convert to a raster illustrating their height. I have the building heights but not their elevation above sea level datum. I have the ...
0
votes
1answer
25 views

Many ELSE statement in Expression in QGIS (2.6) [duplicate]

is it possible to have more than one ELSE in the CASE WHEN statement in the Expression builder in QGIS? For example: CASE WHEN "population" > 5000 THEN 'big' ELIF WHEN "population" > 1500 THEN ...
0
votes
1answer
27 views

How to populate new field according to string content of another field using VB script?

I want to populate a new field called Letting according to the string value found in another field. If 'ASP' or 'Q' is in field ExternalRE then I want 1 in Letting, everything else to be 0. Here is ...
1
vote
1answer
20 views

ERROR 000989 Issue with Python Script and Field Calculating distance between two long lat points

very new to scripting and I have been struggling with my script for a while. I'm not sure why it doesn't work in field calculator. I am trying to calculate a list of distance between two long lat ...
1
vote
1answer
174 views

How to create sequential field based on sorted data? (or extract pop-up data?)

I downloaded a kmz field and converted it to a GDB fc on arcmap. However, the field I need to label the layer by is stored in the pop-up html field... It looks like this: <html ...
0
votes
2answers
896 views

ArcGis Python Script, Calculate Field

Sorry for my English. I am trying to write a Python Script for ArcGis 10.2. #import system modules import arcpy import math from arcpy import env #Set environment options ...
4
votes
1answer
136 views

Calculating a Unique ID on a Subgroup of Polygons

I would like to assign a unique ID to polygons in a dataset. The catch to my issue is that I would like polygons that fall within a polygon to have the same unique ID. My example is related to ...
0
votes
1answer
24 views

Copying the numeric portion of an address to a new field

I'm attempting to copy just the numeric portion of a street address into a new table using the Field Calculator in QGIS. The expression I'm trying to use is: left( "SITE_ADDR", strpos( "SITE_ADDR", ...
1
vote
1answer
36 views

What is the expression for getting a subset of characters in QGIS Field Calculator?

I have a column of 10 character names e.g. L3NAM1988K. How can I delete the first 5 characters and the last 1 character using an expression in the QGis Field Calculator?
0
votes
0answers
99 views

Python script to get feature count in a feature class that fall in a specific range

I need to write a Python script to be used in the ArcGIS Field Calculator that will return a feature count for values between a range defined by the values in two other columns. Here is a graphic ...
0
votes
0answers
21 views

Python script to get count of features that meet a certain criteria [duplicate]

I am in search of a Python script for use in the ArcGIS Field Calculator to return the number of features that meet a certain criteria. Here's where I am getting stuck: def ...
0
votes
1answer
58 views

Is it possible to have auto-updating area fields?

I'm using QGIS 2.4.0 and I've noticed some problems with the derived area and the $area field. Firstly, I have a polygon which is a filled ring, inside another polygon. The derived area, and therefore ...
1
vote
1answer
48 views

How to calculate distances in QGIS field calculator?

So I'm using qgis 2.6.0 and I have a csv (converted into a .shp) with two geometry columns, I want to create a new column with the distance between the two geometry: shot.lat shot.lon haul.lat ...