Field calculators (which are available in QGIS, ArcGIS-related products, etc.) can recalculate the values of a single field, on all, or selected records within a table based on a symbolic expression.
15
votes
6answers
3k views
ArcMap 10.0 Python Field Calculator, Find/Replace Double Quotes
I'm trying to use the Field Calculator (ArcMap (10)) to strip out double quotes in an address field (I didn't put them in there, believe me). I've tried many incantations but am still unable to even ...
10
votes
2answers
550 views
How to compute a new attribute based on changes in another attribute?
I am attempting to classify a set of gps time-encoded point data into behaviors based on different attributes. I have created an attribute that is 0 for home and 1 for away based on location, and now ...
8
votes
3answers
1k views
How to round a column in attribute table (ArcMap)
I want to use the Field Calculator in ArcMap to round an existing column to two decimals. Currently I have a column that is 6 decimal places long and would like to simply round it down to 2 decimals.
...
7
votes
4answers
1k views
How to remove numeric characters from alphanumeric value in field calculation?
I have a field containing alphanumeric values in the following format:
A-AA00
Sometimes they are also
A-AAA0
I need a Python script I can put in the field calculator in ArcMap 10 that will at ...
7
votes
2answers
2k views
How to calculate perimeter of polygons in Quantum GIS?
Is there a way to calculate perimeter of polygons with the field calculator of qgis, like there is for area calculation?
7
votes
7answers
1k views
How to Remove return/newline (\n) character from Field using Python and Field Calculator?
I have a geodatabase table with a field that I'm trying to remove return characters (new line). I found this post (How can I remove (chomp) a newline in Python?) of how to do it, however it is not ...
6
votes
2answers
2k views
Basic Field Calculator Python Question
I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why.
I'm trying to create a ...
6
votes
4answers
3k views
Field Calculation - Python - If/Then over multiple data columns
I have some VB code saved that looks at two columns of data, and populates a third with the low value.
Pre-logic Script Code:
Dim output as double
if [MIN_LEFT] < [MIN_RIGHT] Then
output = ...
6
votes
2answers
621 views
Calculating Field based on name of shapefile
I have multiple shapefiles to which I have added a field called "gname1". For each shapefile, I want "gname1" to be set to the name of that particular shapefile, for every feature within the ...
6
votes
1answer
434 views
Editing tables using SQL in ArcMap
We've recently started working with ArcMap, having used MapInfo previously. I've created a shapefile in ArcCatalog and want to update some columns using SQL. In MapInfo I'd write the following command ...
6
votes
1answer
1k views
ArcMap Field Calculator syntax (again)
I'm trying to string together a field calculator script that will populate all the records of a field at once based upon values in a number of fields. I can't even get the first part of the command ...
5
votes
2answers
598 views
How to find wildcard string using Field Calculator script code?
I'm trying to find part of a text string in the CLASS_NAME field and return a text string to the Abrv_Name field using the Field Calculator in ArcGIS 10 via a Python parser.
Here is what I have tried ...
5
votes
4answers
4k views
How do you test for a NULL string field in the Field Calculator with Python?
I am trying to perform an operation on a string field with a condition that it contains data. Referencing None with Python does not appear to work when the field is nullable and contains <Null> ...
5
votes
5answers
2k views
How can one execute an SQL script in field calculator in ArcGIS 10?
I am trying to transfer over row data from a table to columns in a shapefile table. There is a common "SA" variable between the two (i.e. the study area number) but there is more than one land use ...
5
votes
1answer
413 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 to ...
5
votes
2answers
222 views
How to add a sequence to the attribute table?
Is there a way to use the field calculator in QGIS to create a range of values in a count sequence with a specified input range? For example, if I wanted to have the values 1 to 5 repeated within my ...
5
votes
3answers
1k views
Is there a way to concatenate fields in field calculator of QGIS?
Is there a way to concatenate fields in field calculator of QGIS? (e.g. hectares + ' ha')
5
votes
1answer
526 views
How to measure area correctly?
I have now used my entire evening, but 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" ...
5
votes
2answers
2k views
Using Field Calculator in QGIS to update columns with centroid coordinates
In QGIS I would like to update two columns with the centroid easting and northing of my polygons. I am using the field calculator. I have tried using $x and $y but this only seems to work for points.
...
5
votes
1answer
1k views
Python Field Calculator ArcGIS 10 expression for a RANGE
what is the python expression for defining a range of numbers? I have tried numerous combinations but cannot get a simple range of angles (100 -200) to compute correctly. Screen shot :
screen shot ...
5
votes
2answers
96 views
Using field calculator to delete specific contours
I have 3 contour shapefiles with 25m, 50m and 100m equidistance. Now I want to delete in the 25m-shp-file every **50m and **00m contour and in the 50m-shp-file every **00 contour. How can I show them ...
5
votes
1answer
745 views
Get shape filename in attribute field using field calculator
I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
5
votes
2answers
345 views
Random value calculation in QGIS
Is there a way to do a random value calculation within a range in QGIS? I have been able to do this within ArcMap Field Calculator with the following code:
Dim max, min
max=20
min=5
...
5
votes
2answers
2k views
Converting from DMS to DD using Python in Field Calculator
I need to convert lat/long that is expressed as degrees, minutes, and seconds in the data into decimal degrees. For example, in the data, they are listed as N335042.06 in the Latitude column, and ...
5
votes
2answers
848 views
ArcGIS 10 Field Calculator doesn't notice selection/Attribute Table problem?
I just have an annoying problem with the Field Calculator in ArcGIS 10.
I selected specific points of a Shapefile I want to calculate, but FC is always calculating all fields. Unfortunately there is ...
5
votes
1answer
112 views
How to add attributes in proportion to intersecting area from another layer
I am new to using QGIS. I have two polygon layers:
Voronoi of Access Points
Census block maps with population
I want to get number of people covered by each Access Point (Assuming uniform ...
5
votes
0answers
166 views
How to set order of operations for Field Calculation in Network Analyst Evaluator Dialogue?
I desire to have a ratio calculated each time I create a new route. To get this ratio, I created and populated a field that multiplied the length of each segment by a designated number from 1-5, where ...
4
votes
2answers
2k views
Arc 10 field calculator scripts
I need scripts for the field calculator that, 1. extracts the first word from a column, i.e. Jones School - Jones, and 2. A script that will capitalize this new field, Jones - JONES.
This is Arc 10. ...
4
votes
1answer
742 views
How to convert state name abbreviations to full names?
I have a data table with columns that includes city names (ex: San Jose) and state name abbreviations (ex: CA). Is there a way to define the state names as their full names (i.e., CA = California) and ...
4
votes
1answer
1k views
How do I add a hyphen to the Field Calculator to merge 2 columns?
I am trying to build a field calculator expression to merge two columns into one. I am looking for the word that makes it a range.
Example: I have 2 columns in elevation, From and To. I want to ...
4
votes
3answers
3k views
ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script
I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...
4
votes
1answer
2k views
Find and Replace expression needed in Field Calculator ArcGIS 10
Looking for the Field Calculator code (Python preferred) to replace the last numeral values in a field using another field's values for entire attribute table. Please see screen shot here:
4
votes
1answer
265 views
How to add attribute data up?
Sorry if this question is too simple/easy for you guys, but I'm still learning QGIS and pretty much teaching myself where I can.
Is there a way to add data from 2 columns into one new column inside ...
4
votes
3answers
318 views
Moving “last name” from last to first in the Attribute Table
How do you get e.g. "John D. Doe" to "Doe, John D." in the AT using VB Scripting without going individually going through each line? I am using ArcGIS 9.3.
I should note that not all the names are ...
4
votes
5answers
767 views
Is there a Log or Ln function in QGIS Field Calculator?
I can't seem to find any way to take the logarithm (natural or base 10) of a field in QGIS. I have gotten to the field calculator but there is not a button for log and I can't seem find any formula ...
4
votes
4answers
162 views
How do I fill in serial letters (AA, AB,AC…,BA,BB,BC…ZZ) to a shape?
(I am using ArcGIS software, ArcMap...)
MY PROBLEM
I have a shape file containing points. The shape file contains 3 columns named FID, Shape* and Label. In the column I want to fill in AA, AB, ...
4
votes
2answers
95 views
ArcMap: Calculate Quarter using Date field
I am using ArcMap 10.0 and making a map where I symbolize on annual quarter (i.e. Q1 2013, Q2 2013, and so on by quarter through 2015).
If a date field contains this: 01/15/2013, and I wanted to ...
4
votes
2answers
766 views
Field calculation- Arcpy
I am developing a script to calculate the values of two fields (C and D) based on value of field A (It is a Point feature):
A C D
0.2 1 1
0.2 1 2
0.2 1 3
0.4 2 1
0.5 3 1
0.5 3 2
So the idea is
n ...
4
votes
1answer
338 views
Why can't I multiply two string fields in the Field Calculator by converting them to int() and float()
I'm using ArcGIS 10 and new at python scripting. I have a string field that I need to calculate by multiplying two other string fields. I can do it in python using two arbitrary values...
CINPT1 = ...
4
votes
3answers
2k views
ArcGIS 10 Python split string
I am trying to use Python to split a string field into three new fields at the separator " - ". The field is in the format "a - b - c". So I initially had this in the field calculator for newFieldA:
...
4
votes
2answers
980 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 ...
4
votes
4answers
541 views
How to concatenate numbers and add in leading zeros?
I have three text fields populated as follows: 1, 9, 1 that I need to concatenate into a field that looks like 01.09.01. Getting to 1.9.1 is easy but can anyone help out with how to formulate it so ...
4
votes
1answer
661 views
Qualifying field names in field calculator
I am trying to set up a quick model that:
Takes a point feature layer of development projets (a table in an access database with xy coordinates),
Spatially joins polygon neighborhood designations to ...
3
votes
3answers
4k views
Simple field calculator equation in ArcGIS 10 not working
I'm new to ArcGIS 10 and am trying to do a really simple field calculator equation and it is not working. I'm just trying to find the percentage of a certain demographic trait by doing:
...
3
votes
3answers
81 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, ...
3
votes
1answer
472 views
Using Python to Calculate a field
I am trying to replace values in a single column using an else if statement, but I keep getting an Syntax error in line 2. I'm new to Python so it's probably an easy solution, but I haven't been able ...
3
votes
3answers
227 views
Auto-calculate field (area or formula)
I'm wondering if anyone has any insight into the potential to auto-calculate the value of a field, either area or distance (ideally) or a formula (based on the values of say 2 other fields, or an ...
3
votes
2answers
260 views
Python find string with two decimal characters
I have two columns in a personal geodatabase table that I'm trying to add up (to a third field) using a python function in field calculator, however some of the string values are not real numbers.
...
3
votes
2answers
439 views
Why is ICalculator.Calculate significantly slower than the CalculateField geoprocessing tool with SDE datasets?
I just discovered today that there are essentially two ways to calculate field values in ArcObjects:
1. Using ESRI.ArcGIS.GeodatabaseUI.ICalculator:
ITable table = …;
ICursor updateCursor = ...
3
votes
2answers
1k views
using mod() with IF THEN field calculation
I am trying to use the field calculator to assign a "odd" or "even" value to a field of small integers. I usually do this with by selecting where:
MOD([field],2) = 0
and then just calculating it ...

