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

3
votes
1answer
4k views

Elseif Conditional Statement in QGIS Field Calculator

I am trying to write an ELSEIF conditional statement in QGIS Field Calculator (version 1.8.0). I have used an example I found online: CASE WHEN val < 0 THEN 'negative' WHEN val = 0 THEN ...
3
votes
2answers
439 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
800 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
1answer
2k views

How to count and record the number of entities with the same name in the field calculator?

I have a question with ArcGIS 9.2. In an attribute table the column [name] includes the name of every place in this layer. Next to that (in columns [numbers]) there should be recorded how often a ...
3
votes
1answer
211 views

Using Python in Field Calculator to compare two fields

I'm trying to use field calculator to compare two fields in a table of tax parcel data, Land Value (LAND_VAL) and Improvement Value (IMPRVT_VAL). My goal is to determine (1) Parcels with land value ...
3
votes
2answers
81 views

How To Determine Percent of Matched Data?

In my attribute table, I have 2 columns with qualitative (categorical) data. Both of them are from different sources so I am trying to find the percent of matched data from these 2 columns. I created ...
3
votes
1answer
98 views

How to find lowest value that is not null using Python in ArcGIS for Desktop?

I have four fields in my table, (A,B,C,D). The field type is double with some fields being NULL. I used min(A,B,C,D) to return the smallest value and it works well if there are no NULL value in any of ...
3
votes
2answers
442 views

If-Then Statement in Field Calculator

Scenario: I have four fields: A, B, C and D Field A is text-based and contains values from '000' up to some number 'xxx' Field B contains a set of values (also text, but represented by numbers) ...
3
votes
2answers
2k 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 ...
3
votes
1answer
111 views

QGIS - Is it possible to increase Output Field Name?

When creating a new Column, the default value for the length of the name is 10. Using the Field Calculator via the Model Builder, I want to include the names of regional areas into the columns which ...
3
votes
3answers
287 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 ...
3
votes
2answers
595 views

Adding VBA into a Python script generated by ModelBuilder

I have created a model that does a calculate field and have used VBA in the code block. But when I export it to Python, it doesn't work. Here is the VBA code: new_value = ...
3
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? ...
3
votes
2answers
144 views

Expression to calculate and sort data from several layers into one layer

I am trying to develop an expression whereby one layer can add data from 2 other layers and then rank them, is this possible? I have also tried the problem with using just 1 layer but I cannot work ...
3
votes
3answers
426 views

How to create button that calculates acres on selected polygon features?

I'm looking to create a simple button that calculates acres on selected polygons and can't quite find what I'm looking for. I read through this thread: automating a python script..., but found it ...
3
votes
1answer
355 views

Measurement units not returned in project CRS units

I am attempting to calculate area of country polygons using the field calculator. The layer in question is unprojected WGS84, but I have set the project CRS to World Equidistant Cylindrical ...
3
votes
1answer
63 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
125 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
2answers
110 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
102 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
582 views

How to use the field calculator's centroid() Geometry function in qgis 2.0?

There is an option in the field calculator for centroids under geometry which when you double click gives you "centroid( ". What information is required here in order to use this function?
3
votes
1answer
567 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
1answer
1k views

Why does Field Calculator return 0 values when decimals are expected?

I realize I posed this question, and got answers, several days ago (see (Field calculator error)) , but none seem to really be working, and so am posing again. Below are two screenshots that show the ...
3
votes
2answers
368 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
495 views

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

I have been racking my brain, but I can't seem to find a solution to appending my field values in my .dbf to correspond with the values of my feature's attribute table. All I need to do is to append ...
3
votes
2answers
59 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
93 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
2answers
234 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
997 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
659 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
117 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
1answer
40 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
1answer
84 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
0answers
73 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
55 views

Can you use wildcards for column headers in Field Calculator?

I know you can use wildcards for fields like so (in the Field Calculator): case when "column" ILIKE '%example%' then 1 else 0 end Can you do something similar for the column headers themselves? I ...
3
votes
0answers
49 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
76 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
60 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
2answers
463 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
1answer
67 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 ...
2
votes
3answers
218 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
2answers
260 views

Round decimal number in ArcGIS10.1

How can I round the decimal number in a table in Arcmap: e.g. how can I set it to 2.60?
2
votes
1answer
355 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
103 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
3answers
705 views

How to count occurrences of one field grouped by values of another?

Is there a way of calculating the number of unique text strings in a field in ArcGIS 10.1? I have a number of repeated strings in this field, but would like to calculate the number of unique strings ...
2
votes
2answers
498 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
822 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
4answers
3k views

Basic Field Calculator help

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
2answers
151 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 ...