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)

0
votes
2answers
37 views

Split a string between 2 characters

I have the following string in Arcmap: "Node 1_1234.23,Node 2_567.88,Node 3_45.25" I want to return the numbers between the "_" and the "," into three columns e.g "1234.23" in column A ...
-2
votes
0answers
58 views

Python field calculator

I have a point shapefile with the following columns mosaic hypo result condition 2000 1700 1500 1000 980 . . AND i want to write a script that will do the following: ...
1
vote
0answers
26 views

Create new attribute ranking polygons by size in QGIS

I'd like to create a new field in the attribute table which gives the rank of the polygon by size. For example, the polygon of the largest size would be rank 1 and the smallest rank N. I was hoping ...
3
votes
0answers
50 views

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

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 ...
5
votes
2answers
250 views

Calculating Quarter (Q1, Q2, etc) using Date field in ArcMap Field Calculator?

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 ...
1
vote
2answers
35 views

How to generate random points from FIDs using ArcPy or ArcGIS Field Calculator?

I'm trying to generate a shapefile of random points using FID from the attribute table. My attribute table has 800,000 features and I only need a sample of 240. Is there a way to do it in arcpy or in ...
0
votes
0answers
30 views

How would I use field calculator to mark min & max values associated with a case field? [on hold]

I have a point shapefile for which I need to mark the minimum and maximum point value that is tied to a case field. Once marked I would use the marked values to symbolize categories 100th, 1000th and ...
1
vote
1answer
43 views

Add and Calculate Field in Table with ArcPy?

I have written the following script to iterate it as a tool for all my tables with ModelBuilder, but i have a problem wth my codeblock. I want to add a field FID to all my tables and to add the values ...
2
votes
1answer
149 views

Syntax for ArcGIS ICalculator object?

I have a code snippet that I can't figure out: 'Define a calculator for NewArea field pCalculator = New Calculator With pCalculator .Cursor = pCursor .PreExpression = "Dim ...
5
votes
1answer
181 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 ...
3
votes
2answers
84 views

Field Calculator Script

I am looking to check how up-to-date a feature class is by using our latest parcel update. I am wanting to check "owner" field with "Owner_1"...I am using field calculator to grab the last name in ...
2
votes
2answers
167 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 ...
1
vote
1answer
223 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
40 views

Error msg “Name is not defined” when trying to populate a field with the shape file name

I am trying to populate a field with corresponding file name. For example, if the file name is Route1.shp then the field value will be Route1 as well. However my code is not working. Can you please ...
2
votes
2answers
56 views

VBScript - If/Then Statement - Field Calculator

I am trying to do a simple (or so I thought) if/then statement in the ArcGIS field calculator. I am trying to add the HydroCode field - hydologic soil codes - to an existing data set. I know what the ...
1
vote
1answer
48 views

Area is calculating wrong using $area in field calculator (QGIS 2.8.1-Wien)

There is a similar question posted, but the solution to it seems to be that polygons were multipart: Wrong $area from field calculator (QGIS) In my case, all polygons are singlepart. I have several ...
0
votes
0answers
19 views

Creating a field calculator function that can cast string to a percentage value in a related field?

I am having issues trying to create a field calculator function based on a coded domain string parameter combined with a numeric field to obtain a percentage output. The example in question is as ...
1
vote
1answer
97 views

VB Script can't run in Field Calculator

I wrote a simple script in VB. But it failed to run in field calculator. I can't figure out what is wrong with it. Below is a screenshot. Thanks for your help.
1
vote
1answer
39 views

Update all cells in column to match value of first row?

I have a point layer; the attribute table includes x and y coordinates of original centroids associated with the points (the points were generated from the perimeters of circle features and still ...
1
vote
2answers
35 views

How to update a bulk selection of fields using field calculator in QGIS 2.8.1

I have an attribute table showing vegetation communities. The table has three columns ("ID", "Veg Comm" and "Area_ha". Instead of having to copy and paste text after each polygon created into each ...
-2
votes
0answers
27 views

Field calculator language [duplicate]

I am trying to edit an column of numbers in to texts. For example, if the SITE TYPE is 2 then the site_type (an added field which is blank) is Industrial. If there a way to use python to make it work? ...
1
vote
3answers
42 views

Generate a string based on an integer range

After some initial research, I was unable to find a solution for the following issue. I'm sure there's an answer to this question already floating around here somewhere, but hopefully someone can give ...
3
votes
1answer
157 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 ...
7
votes
1answer
845 views

Meaning of exclamation mark in Python parser of ArcGIS Field Calculator?

In the following line, I don't understand what those exclamation marks mean? And why put everything in quotation? I don't understand the purpose of the variable expression, please explain to me as I'm ...
0
votes
2answers
56 views

ArcGIS Python if statements say field not nullable?

I am creating a new field - let's call it A (SHORT INTEGER) in shp file using Modelbuilder and I need to fill it it with the values from two different fields. First step is to fill field A with the ...
1
vote
3answers
528 views

Using python elif syntax in Field Calculator to reclassify a range of values from a different field and populate a new field

I'm trying to use the Field Calculator with a python elif statement to reclassify values from a different field and populate a new field, and while I'm not getting an error message of any kind, I'm ...
1
vote
1answer
55 views

How to use QGIS field calculator between different points of same layer?

I'm in a course learning about GIS systems, and we have recently recorded a gps track. I've exported this track as .gpx and imported the points into QGIS. Each point has a timestamp. One of the ...
1
vote
1answer
351 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
236 views

Replacing attribute table entries using Python script

I am using ArcMap 10 from ArcGIS 10.2.1 package. I got an attribute table, with few collumns. I need to replace some column "String_A" entries with newer "String_B" entries, in the same row. In both ...
0
votes
1answer
39 views

Using field Calculator for time in ArcGIS 10.2

I have a new field in a shapefile with the property "Date". I want to fill it with "9:00:00 AM". I tried several ways of using field calculator, but it gives date instead of time. How could I do ...
1
vote
2answers
37 views

How to remove a certain number of digits from the front or end of an attribute field?

Can I use the filed calculator in QGIS somehow to remove the first 4 numbers in all attribute fields in a column? Example 16011234 -> 1234 EDIT: Silly, I can just subtract with 16000000 in this ...
1
vote
1answer
2k 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 ...
1
vote
1answer
30 views

Using “calculate field” in python script fails to display Arabic characters correctly

Using “calculate field” in python script fails to display Arabic characters correctly. I have exported the modelbuilder to python script, but unfortunately the Arabic characters cannot by displayed ...
1
vote
1answer
49 views

Calculate area intersected areas, problem

(I'm working in QuantamGIS) I intersected two layers creating a new layer. Within the attibute table of this new intersect layer i would like to calculate the new areas. However, it just doesn't ...
1
vote
1answer
78 views

ArcGIS Calculate Fields gives Warning 000405 No records within table?

Situation: I have feature layer sitting outside processing extent in Environment settings. If I open layer's table and use field calculator - Calculate Geometry on some numeric field: it works ...
0
votes
1answer
39 views

Combining and extracting attributes from 2 columns to populate a third (Concatenate)

I am working with a FEMA flood zone shapefile which contains a FIELD_ZONE field and a SUBTY field. I created a third field called ZONE_TYPE that needs to be populated by combining or extracting ...
1
vote
4answers
206 views

Python script for Field Calculator. ArcGis 10.2.2

I have a point shapefile with two columns i want to process. The first column is aspect and the second is aspect_m60, there is only one row with the aspect of my point. I have tried to write a script ...
3
votes
1answer
62 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 ...
0
votes
1answer
33 views

How can I make attribute table field dependent? [duplicate]

In an attribute table I am making new fields bounded each other by the Field Calculator. Once I have written the formula for the new field in the Field Calculator, ArcGIS make the calculation for the ...
-3
votes
2answers
79 views

Using ArcGIS field calculator? [closed]

This field calculate returns an error, whats wrong with it? def Reclass(A): elif ( A>= 0.208113 and A <= 0.261517): return "Low" elif (A > 0.261517 and A < 0.301951): return ...
4
votes
4answers
1k views

How to insert a quotation mark through the Field Calculator of attribute table of a Shapefile?

I have a shapefile of polylines with information of diameter. But the problem is that i didn't enter the inch sign(") with the values of diameter. What would be the solution that qutation mark would ...
0
votes
1answer
46 views

If statement problem in Field Calculator - Arcgis

I have a field entitled "Lung_lunc". It contains some "0" values and the rest are values > 0. I want to turn those "0" values, into "0.0001". I have added a new field: "Lung_lunca", and I want to use ...
1
vote
2answers
96 views

How do I add rows together to populate a new field?

How do I add the values in columns 11_acciden, 12_acciden, 13_acciden, and 14_acciden in order to populate the total_acci column?
1
vote
1answer
56 views

How to fill the column in attribute table with same values?

I have about 19000 records, I added new column and I would like to fill it with string values (eg. brand)- same value for all rows. I'm not considering copy/paste. I know I could do it with exporting ...
1
vote
2answers
65 views

How to assign a unique ID to groups of items in the attribute table in ArcMap?

Using arcmap's field calculator I need to programatically loop through all of the entries in the field and for each name it gets its own unique id. So names that are the same would get the same ...
2
votes
1answer
61 views

How can QGIS Field Calculator sum values from a spatially joined table?

Can the Field Calculater be used to sum values from a related table via a Spatial Join? I have two vector polygon layers A and B, each with a numerical column VALUES. I want to update VALUES in ...
2
votes
2answers
169 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)
1
vote
1answer
56 views

ArcGIS Field Calculator nested elif is None not working

I am calculating a field based on two other fields in ArcMap 10.2 using python. My Pre-Logic Script Code is def myfunc(legend,Btype): if(legend == 'Apple'): return 'Banana' elif(legend == ...
6
votes
3answers
14k views

Basic If/Then in ArcGIS 10.2 Field Calculator (Python or VB)

I've been looking through these threads and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with Arc.I know I can do this the slow way with Select By Attributes, ...
-1
votes
1answer
83 views

Rewriting VB codeblock as Python for ArcGIS Field Calculator?

I am looking for assistance to rewrite my VB codeblock into Python. Im on Win7, Arc10.2 and Python 2.7 The code below works fine for me, I am simply looking to port it to Python so i can progress down ...