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.

learn more… | top users | synonyms

15
votes
6answers
4k 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
824 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
2k 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. ...
8
votes
5answers
272 views

Print out the properties of the attribute table in qgis?

I have to merge a lot of shapefiles into one great shapefile. So I want to compare the properties of the attribute tables to see if there are differences between the tableproperties of each shape ...
7
votes
4answers
2k 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
3k 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 ...
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
3answers
2k 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')
7
votes
7answers
4k 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 ...
7
votes
2answers
1k 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
4answers
4k 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
4answers
6k 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> ...
6
votes
2answers
3k 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. ...
6
votes
1answer
2k views

Calculate area within Python script in Arcmap

I am trying to calculate the area of a polygon within my Python script. I create a new polygon from merging two together, and I'd like to add the area of the resulting polygon to a field in the output ...
6
votes
1answer
2k 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" ...
6
votes
1answer
1k 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 ...
6
votes
3answers
736 views

How to replace non-English characters in attribute tables using Python?

I have a few shapefiles where some of the attributes contain the non-English characters ÅÄÖ. Since some queries doesn't work with these characters (specifically ChangeDetector), I tried to change them ...
6
votes
2answers
501 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 ...
6
votes
2answers
3k 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 ...
6
votes
1answer
680 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
2k 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
888 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
3answers
647 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, ...
5
votes
1answer
268 views

Translate Excel formula to be used in field calculator

I have a series of equations to create corner points to make rotated polygons based on angles in the attribute table, but I have created it in excel and can't figure out the syntax to get it to work ...
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
2answers
416 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
1answer
921 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
1answer
1k 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 ...
5
votes
4answers
542 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, ...
5
votes
2answers
168 views

Field calculator script to work out first 5 dominant area fields?

I have 5 fields of different landcover types with areas of each and found below: > PRC_Water| PRC_Bare| PRC_Urban| PRC_LVeg| PRC_LVeg| > 5 20 40 20 15 I have ...
5
votes
1answer
2k 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
141 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
2answers
1k 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
205 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
1answer
56 views

Calculate difference between values in linear order using ArcGIS

The best way to describe this without knowing Python or VB jargon is to add these screenshots. I would like to emulate this Excel calculation in ArcMap10.1. MEAS is the distance along my route and ...
5
votes
0answers
196 views

How to set order of operations for Field Calculation in Network Analyst Evaluator Dialogue? [closed]

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, ...
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
484 views

Python If else statements

I'm trying to populate a field from another. The catch is that it isn't 1 or 2 values. If my field A = 4 then I want it to return field B to 0. But if Field A is 1, 2 or 3 then I want the user to be ...
4
votes
1answer
1k 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
2k 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
4k 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
3answers
216 views

How to find/replace element in field with Field Calculator

I just want to perform the following operation done in Matlab into the Field Calculator using Python: p(p==0) = 0.001 ; p(p == 1) = 0.999; tVar = .5*log(p ./ (1 - p)) the operation consists of a ...
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
374 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
411 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
908 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
2answers
158 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
966 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
3answers
3k 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
131 views

Can Hyperlink be based on two fields for path and file name separately?

I need to create a hyperlink field. I have one field with the file name, and another field that contains only part of the file path (the real path is unknown). The table contains 14,000 records with ...