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)

3
votes
1answer
215 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 ...
3
votes
1answer
124 views

Trouble calculating areas in QGIS using field calculator

I am testing various projections to calculate areas using ICES statistical shapefiles and the QGIS field calculator. I am using ICES areas downloadable from the following link: ...
3
votes
1answer
283 views

Why is this field calculator expression evaluated incorrectly when using Python syntax?

I have a polygon featureclass containing an integer field 'gridcode'. I've added 2 new float fields VB_calc and Python_calc, both of which should be equal to gridcode / 1,000,000. If I calculate the ...
3
votes
1answer
108 views

How to find and replace a singe word in a string?

How do i find and replace a single word of a string? e.g. Calle Iparraguirre to Iparraguirre I've tried: replace( 'Calle\\s', 'Calle\\s', '') replace( "name",'calle','') and all combinations ...
3
votes
2answers
146 views

ArcGIS 10 Field Calculator [closed]

I'm new to GIS in general and field calculator in particular. I have a basic attribute table with three columns. I'd like to assign values to column C based on what is in column A. If Column A = 8 ...
3
votes
1answer
115 views

Field calculator uses wrong fields when working with joined data

I am having an issue in qgis table joins. i have a joined a csv file to a sqlite database and common id is used for join. the join is displays correctly in attribute table. the attributes in sqlite ...
3
votes
1answer
959 views

Calculate Field python code has “Expected end of statement” error

I am creating a line shapefile from a csv in a Python (2.7) script. I am assigning an ID field from the csv to a variable and then later using it in the Calculate Field tool. The ID field originally ...
3
votes
2answers
447 views

QGIS Field Calculator Results Removed When Saving Edits

Mac OSX 10.6.8 QGIS 1.8.0 : Using the field calculator from the attribute table, the $area of each feature is shown nicely in the table until I try to save it, then all the values are replaced by NULL ...
3
votes
3answers
680 views

How to make Field Value constant size (length) by appending zeros towards end?

How do I append my field values in my .dbf to correspond with the values of my feature's attribute table. I need to append 0's to the field value if the field value is less than 11 characters in ...
3
votes
1answer
105 views

How to summarize a column in QGIS field calculator

I have data with a column containing a number value, and I want to divide the value of each feature by the total sum of all the values in the column (to get a percentage). So I would like to know if ...
3
votes
2answers
160 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 ...
3
votes
2answers
80 views

assign a number for each group in field calculator

I have several thousand features each of which has a name. The names are not unique. what I want to do with the field calculator is assign a number to each name so I can refer to a number and always ...
3
votes
3answers
970 views

How to Populate new field using expression containing MAX value from another field in ArcGIS attribute table using field calculator?

I've got one field X with 10 numerical attributes (float/double). I've created a new field Y (also float/double) which I need to populate with the percentage of each record/attribute (in each of the ...
3
votes
3answers
112 views

Field calculator problem

I have an issue withe the field calculator. It is impossible for me to multiplicate 2 columns (area * KZ). The result is always "0". I used the formula area * KZ....is this the right formula? LINK to ...
3
votes
1answer
2k views

Using the Field Calculator in a Domain field

I have a coded domain field with 10 dropdown options. Possible choices include integers and text. I need to change a selection of 250 features (which have differing values) to the same value. This ...
3
votes
1answer
1k views

How to use field calculator from QGIS Sextante plugin

I am trying to use the Sextante field calculator to calculate a field for a buffer radius using a categorical text field. The formula works fine when I run it using the standard QGIS field calculator ...
3
votes
3answers
835 views

ArcGIS Field Calculator Python numbering rows of fishnet

I have a grid of 100*100 cells. I want to add to each cell a number representing the row it is in (like in excel). I added a field and want try to solve that with field calculator: The code is ...
3
votes
1answer
445 views

Sum up area left “underneath” polygons in QGIS?

I have an area shape layer and multiple other area shape layers. Now I would like to calculate how much space (square kilometers or percentage of area) of the polygons of this area layer is NOT ...
3
votes
1answer
43 views

Add comma to number labels, multiple records in attribute table

A QGIS question: How can I insert commas in 4 digit numbers in an attribute table that has multiple records, with some numbers that are only in the hundreds? It's for an animation so multiple labels ...
3
votes
1answer
178 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 ...
3
votes
1answer
225 views

Calculate population coverage?

I am relatively new to QGIS and hope I explain this right. I am looking at the percentage of an population that has geographical access to healthcare. Therefore I have one shapefile with village ...
3
votes
0answers
58 views

Field Calculator convert text to integer then populate new field with sum [closed]

I have a .dbf with about 50 text fields containing numerals, I would like to convert those to integers and then sum them all in a new double field I created, is there an easy field calculation that ...
3
votes
0answers
234 views

How to calculate percentages using QGIS field calculator expression?

I am new to QGIS. I am wanting to calculate a field using other fields and some operators. Here is my expression: case When "RVM_CAT" = 'B' OR "RVM_CAT" = 'C' Then ("PC1" /100) * "RE_ha" When ...
3
votes
0answers
141 views

Warning 000405 when trying to calculate field [closed]

I am trying to create a model but am getting hung up on my first step. I need to calculate an ID field from an FID field so that I can join it to another table based on the ID field. So I have a ...
3
votes
1answer
98 views

How do I add a field to a table using the QGIS graphic modeler?

I was wondering if anyone could help as I'm struggling to get anything out of the QGIS graphic modeler. For info I have no programming skills whatsoever. I need to be able to add a new field to an ...
3
votes
0answers
86 views

Using Field Calculator to Convert Data Type In Field

I am trying to convert a field that is listed as "String" because it was imported into QGIS as a CSV (rural poverty population percentages by county in NC). I need to convert the percentages field ...
3
votes
1answer
76 views

Do pad functions of QGIS Field Calculator have bug?

I have this expression in the field calculator: regexp_replace('1', '^(\\d+)', rpad('\\1', 3, '0') ) gives 01 rather than 001 as expected. the *pad functions work fine when called outside ...
3
votes
0answers
295 views

Field calculator error [duplicate]

NOTE: This problem is similar to one that was answered here: Why does Field Calculator return 0 values when decimals are expected? I'm relatively new to python, and am trying to run a simple field ...
2
votes
4answers
228 views

Auto populate field with text using field calculator if/then

I've extracted values from a raster to a point file, but now I need a field with the text information from the raster attribute table that corresponds with the value. I've been trying to use the field ...
2
votes
3answers
2k views

Setting Zero values back to NULL

I'm working with ArcGIS 10.2 for Desktop and OS Windows 7. I need to set numeric vales from Zero back to NULL, but I can't from the field calculator. I'm working with a vector file and I need to ...
2
votes
3answers
109 views

Using .len() in IF THEN statement in ArcMap field calculator

I have a string field with values of varying lengths (1-4). I need each value to have a length of 5 characters by adding zeros to the value until the length equals 5. For example: 123 needs to ...
2
votes
3answers
3k views

Using if/elif/else statements in ArcGIS Field Calculator?

I have no experience with Field Calculator in ArcGIS 10. I have a very simple calculation I would like to perform that I could do easily via pure SQL but just can't seem to get my head around it in ...
2
votes
1answer
379 views

Why does this python function return a value of 0 in field calculator?

I am trying to calculate the percentage of a total which the median value makes. I have a column with the median column labelled (i.e. 1st,2nd,3rd,4th column is median), the columns of values and the ...
2
votes
2answers
110 views

How to handle “Error: Town not found” when updating an existing field with Field Calculator?

I want to update a field in field calculator. update existing field is checked. Column to be updated : Column2 CASE WHEN "COLUMN1" IS NOT NULL THEN "COLUMN2" = "Town" ELSE ...
2
votes
2answers
1k views

How to use the replace string function in Field Calculator?

Within an attribute table I'm trying to replace one string with another using the 'replace' function . As an example, there are a number of features whose field 'NAME' contain the string '(B)' and ...
2
votes
2answers
689 views

Why is QGIS Field calculator button greyed out?

I'm using QGIS to attempt to calculate the area enclosed by a set of points that I have capture used a GPS device. I have imported the coordinates from a CSV but when trying to open the field ...
2
votes
2answers
171 views

Increasing speed limit by 35 percent in ArcGIS Field Calculator?

I have a network with a speed limit attributes. I want to increase the speed limit by 35 percent in order to run an analysis for an ambulance. For example, if the speed limit is 60, I will ...
2
votes
2answers
1k views

FIeld calculator gives integer not a real as requested

Two fields "population" and "F06_popula" (both integers) were used in calculating a new field pct-diff. I asked that the new field be a decimal with a width of 10 and precision of 3. The result has ...
2
votes
5answers
349 views

Field Calculator expression to replace string only if it occurs

I have two fields (STREET1 & AKA_STREET_TEST1). I'm having a problem creating a simple IF THEN Python statement in the Field Calculator box. I've been searching the threads for a similar ...
2
votes
2answers
258 views

Updating column in Field Calculator using values of another column?

I am very new to GIS, so I hope to get some help. I am using ArcGIS 10.2 for Desktop. I want to create a new numeric column on my attribute table to store "seasons" in numbers. For example, I want ...
2
votes
1answer
253 views

ESRI File Geodatabase with a field calculator with an incrementing number

I've got a python script that runs on the Field Calculator of a ESRI File Database. Right now it runs correctly in that it will increment the last three digits of the value. But this is a script ...
2
votes
1answer
493 views

How to return absolute values using ArcMap field calculator?

I have a field of number ranging from -50 to 50. Is there a way using the ArcMap field calculator to populate a field with all of these standardised (positive numbers) so I have a range of 0 to 50 ...
2
votes
3answers
50 views

Creating Conditional Statement in QGIS Field Calculator

I've looked up some of the other threads on this topic, however, none have addressed what I am seeking to do. Essentially I have a large data set and I would like to search one field for any values ...
2
votes
3answers
154 views

How do I normalize the values in a single Field (from a table) in ArcGIS?

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. ...
2
votes
4answers
234 views

Field calculator Python else statement question

The codeblock below is run on Field1 and calculates Field1 to equal Field2 if they are not equal. Else it returns Field1. My question is, does the else statement actually recalculate Field1 to equal ...
2
votes
1answer
716 views

How to use Field Calculator to calculate area as percentage?

I am searching for python code to use in Field Calculator to calculate area as a percentage in relation to another field? The area percentage needs be calculated based on the total area for each ...
2
votes
3answers
973 views

Python and CalculateField

I am having trouble with using Python together with my gp.Calculatefield tool in my python script, and I am not sure why.. Heres the code (UPDATED) import arcgisscripting, os, sys myTempWorkspace = ...
2
votes
2answers
533 views

Looking for python/VB script to insert a new uniqe field

Is there any phyton/VB script which will add a field to shapefile which will be corresponding to first three characters from the shapefile name ? I am working in modelbuilder and arcgis 10. Thanks ...
2
votes
1answer
3k views

How to set the value of a field in all selected rows of a table using ArcGIS 10

I have an attribute table in ArcGIS (it's large - around 300,000 elements). I've selected some rows of the table using 'Select by attributes' and I want to set the value of a field for all of those ...
2
votes
2answers
181 views

Performing math in Python parser of ArcGIS field calculator?

I never used python but now I need a code to do this calculation: I'm doing this: math.atan(math.fabs( !Y2! - !Y1!)/math.fabs( !X2! - !X1!) )*(180/math.pi)