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
103 views

Way to find minimum value from a group of values - QGIS?

I'm wondering if there is a way to find the minimum value of a group within QGIS? Basically I need to find the minimum distance of each unique value in a table of about 5000 records. I can do the ...
1
vote
2answers
103 views

Importing text only out of string field to new field for labelling in ArcMap?

I want to import data out of a string field in my shapefile to a new field for labeling. The string field contains river names and codes and I just want to display the text i.e river names
1
vote
1answer
29 views

Debugging Indentation error on Python Parser of ArcGIS Field Calculator?

Would anyone please help me find out why I get an indentation error in line 3 def calc(f1,f2,f3): remove_list = ['01ST', '02ND', '03RD', '04TH', '05TH', '06TH', '07TH', '08TH', '09TH'] if f2 in ...
2
votes
1answer
40 views

Python codeblock to remove numeric characters from a column not working

I am trying to make use of a codeblock found in this thread: How to remove numeric characters from alphanumeric value in field calculation? I put this code into the pre-logic script field of the ...
2
votes
1answer
28 views

type mismatch: 'esri_8' when using field calculator

I am trying to run the VBScript 'round' function using the field calculator on a column for a numeric field that contains a large number of rows (> 500k). When I run the code on a subset of the field ...
1
vote
2answers
114 views

If/else statement in arcgis

I try to fill the fields with the condition if / else but it does not work. I do not know where is my mistake in the code. def TextValue ( !Classe! ): if !Classe! == "Steppe arbustive" or !Classe! ...
3
votes
4answers
1k views

Why do area calculations return negative values?

I have created a shapefile with some polygons and am now trying to calculate the area of these polygons. The original CRS was WGS84, I have reprojected it to WGS 84 / World Mercator so unit is metres. ...
1
vote
1answer
50 views

Adding a sequential number using ArcGIS field calculator to string file and keeping the 0 in front of the number? [duplicate]

I want to know if anyone has a code to count +1 starting at a certain number for Field Calc. ArcGIS. (I.e. 04312, 04313) It also must keep the 0 in front. rec=0 def autoIncrement(): global rec ...
0
votes
1answer
73 views

Using Python for Field calculator?

I have problem with Field Calculator, using ArcGIS 10.2. I tried to write a statement but I don't know what is wrong. I have two columns: The first contains a number code. Every code represents ...
1
vote
1answer
259 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 ...
2
votes
2answers
40 views

Calculate Field using Fieldnames(variables?!)

the Question I have is kind of asked before. But I couldn't figure out the solution. ArcGIS 10.2.2 Python 2.7.5 I`m adding fields to a table using user input for the fieldnames. Then I populate ...
2
votes
1answer
110 views

Copy first row of attributes and paste for each feature

In a newly digitised polyline vector layer, there are 7 columns attributes value that are choosen inside a value map combo-box that MUST be exactly the same for every newly digitised line (I choose ...
5
votes
2answers
372 views

Filling in patterns into attribute table column of ArcGIS?

Attribute tables in ArcGIS are not nearly as easily editable in comparison to something like Excel. For example, you have sorted the table based on some column value, and now want to fill in the ...
1
vote
1answer
193 views

QGIS field calculator expression: selecting min/max values within field groups

I am new to using QGIS (previously used Arc) and trying to get my head round the expressions and Python. I have series of polylines representing routes and require the linear distance from the ...
0
votes
1answer
38 views

Changing Date Format via Field Calculator of ArcMap?

I'm trying to find a function in the Field Calculator (preferably in VB Script) that can add numbers into a field that already has data. I have year data ranging from the 1960s to 2014 in string ...
1
vote
1answer
136 views

Field Calculator: Error message

Field Calculator: using the x- or yat or (0 "or-1" ) expression, I keep receiving an error: An error occurred while evaluating the calculation string: Index is out of range. I have shut down and ...
0
votes
0answers
13 views

Linking Statistics Type with Calculate Field after Table Join using ModelBuilder?

I am attempting to build a model using ModelBuilder in which there is a zone statistics tool being run iteratively for a set of rasters. The input is a blank template table that contains the number ...
3
votes
1answer
612 views

Field Calculate Degree Minute Second in Different Format?

I have a field that is in degree minutes seconds, populated from ET Geowizards COGO Inverse tool. It populates the values as 90-12-28.15 where 90 is the degree, 12 is the minutes and 28.15 is the ...
4
votes
2answers
2k views

Field Calculator does not notice selection? [closed]

I have a 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 no checkbox in ...
0
votes
0answers
42 views

Field calculator and looping for different rows

I have an attribute table as attached and need to use python script code that can hold values as a loop in field calculator model builder and at the end added up all numbers as sum by entering it back ...
0
votes
1answer
41 views

Using Field Calculator with Python Parser and if/elif statements in ArcGIS for Desktop? [duplicate]

I have tried all of below snippets to use Python Parser in Field Calculator and update the values of a field called type based on a filed called MamerMN but in all of them I am getting Syntax error in ...
2
votes
2answers
50 views

Script (ArcPy) vs field calculator (Python Parser) behaviour of getPart in ArcGIS for Desktop?

From time to time I have to access geometry field and shuffle through points in it. Process is simple: Get shape Get it's part Iterate through part's points This is how it looks like in a script ...
1
vote
2answers
67 views

IF THEN statements in ArcGIS Field Calculator

I'm not sure if this would be best handled in vbscript or python, and unfortunately I'm less than novice at both so I'll take any help I can get from the exchange. I'm trying to take my streets layer ...
0
votes
1answer
33 views

CalculateField_management: Different results than in the field calculator

I`m using ArcMap 10.2.2 and Python 2.7.5 I´m tryig to calculate values with the CalculateField_management tool. my script: def mthree(mthre, mtwo): if mthre >= 1: return -3 if ...
0
votes
0answers
21 views

Added Field not showing in calculate field tool in modelbuilder

I am attempting to create a model that adds a field of the same name to multiple output feature classes, then calculates unique values for this field for each feature class. See the model below: ...
3
votes
2answers
229 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 ...
1
vote
0answers
25 views

Calculating full text string between two joined tables in ArcMap? [closed]

Using ArcMap 10.2.2, I performed a basic table join between a few of our electric feature classes to update the "Line and Pole" field with the attributes in the "Fuse Size" and "Fuse Type" fields. ...
0
votes
0answers
57 views

How do I calculate the travel time between patients and hospital by helicopter and make a map out of it?

I have a layer(.shp) with hospital location and a layer(also .shp) with pick up positions of patients by helicopter. The table with the position of patients has two columns, one with departure time of ...
0
votes
2answers
48 views

Finding and copying text with Field Calculator in ArcGIS for Desktop?

I'm trying to find every instances of an "Avenue #" in the Name field and have Field Calculator copy that over the single letter written in the Subname field so that both fields look exactly the same, ...
0
votes
1answer
24 views

Populate Integer Field based on Text Field

Using ArcGIS 10.2.2 In the picture below, I want to populate the Spd_Class field (short integer). The value of the Spd_Class attribute will be based on the TYPE field - residential = 30 secondary = ...
0
votes
1answer
49 views

Auto increment field that begins with text in ArcGIS

I am searching for a way to auto increment an ArcGIS field which begins with text and followed by numbers. Ex. SWCL0000. I have tried the auto increment code in the field calculator but once I added ...
1
vote
2answers
56 views

using field calculator on string field that has some empty values?

I have a CityState field that has the city and states of landowners. Bellingham WA, for example. I am making two new fields, OwnerCity and OwnerState in which I strip the last two characters of ...
6
votes
3answers
738 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 ...
0
votes
1answer
37 views

Extract acres from legal description

I need to extract the acres from the legal description. I have tried "(!Legal!.split(" AC")[-1])" but it gave an error. I am using ArcGIS 10.2 using python in the field calculator. I realized why ...
1
vote
1answer
30 views

Field Calculator Mass Change Freezing issue, Any other options?

I have a list of ~2300 points, that i need to change a whole field's ("JointUse") attributes from null to "N" (for No). I've tried doing the basic field calculator change but I'm assuming since I'm ...
1
vote
1answer
396 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. ...
3
votes
2answers
2k views

Populating field with max M value of feature using Python in ArcGIS Field Calculator?

I need to calculate the max M value for a line feature using Python in ArcGIS 10 Field Calculator but I cannot figure it out. In 9.3 I used the follow VBA expression… **Pre-Logic VBA Script Code:** ...
22
votes
3answers
37k views

How to calculate polygon areas in QGIS?

Hi I would like to simply calculate areas of a area-shape file in square meters or in acres (ha). I didn't find that functionality in the vector tools. Could anyone here help me with that?
5
votes
5answers
241 views

How to combine text and integers in a string field?

I have field with numbers in it (field type: double, number format: numeric) and I need to create a new field and put text in front of the numbers. I know that I need to add a new string field, but ...
5
votes
5answers
657 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 ...
1
vote
3answers
90 views

Lists in field calculator in ArcMap?

Would anyone please indicate to me why this is not working. I am trying to convert all instances of '02ND' to '2ND' for example where some of the input fields (f1) are already converted and some are ...
1
vote
0answers
35 views

Using ModelBuilder or Python parser of Field Calculator to check values between two datasets?

I have a *.dbf that I need to check values against for a shapefile. I need to report whether the values match the dbf in the shapefile and, if not, what the value should have been (in two new ...
1
vote
1answer
48 views

How to calculate azimuth in QGIS field calculator?

Is there any way to calculate the azimuth of two points in the QGIS field calculator? The coordinates are stored in an attribute table. x1 | y1 | x2 | y2
1
vote
1answer
35 views

How do I move the last two characters of a column within the attribute table to another column?

I have data in a column that looks like the below example: El Monte CA I need to move the last 2 characters to a separate column. Which function in the field calculator will deliver those results?
0
votes
2answers
123 views

Using Python to field calculate Lat/Long with decimal degrees rather than meters

The below is a snippet of a python script that I am writing that basically adds two fields - Latitude and Longitude, then calculates them. I could use the Add XY Tool which gets me to the same point. ...
2
votes
3answers
2k views

Use Feature Class “Name” from Iterate Feature Classes to Calculate Field with Model Builder 10.1

My goal is to create shapefile that contains merged feature classes from a geodatabase. I would like for there to be a new field in the resulting shapefile that contains the name of the original ...
1
vote
1answer
59 views

Trying to export stacked text to CAD using ArcGIS 10.2

I've been experiencing some unwanted results when trying to export stacked text to CAD using ArcGIS 10.2 for desktop. With the Export to CAD tool I can easily export polygons. However, I'm also trying ...
1
vote
1answer
16 views

How to add the values of a common field to a field during union

If I have say 3 overlay features; A,B,C each has a field called FIELD_ID If I do a union, I will get 3 new fields in the output: FIELD_ID_1, FIELD_ID_2, FIELD_ID_3 But how do I get just one ...
-1
votes
1answer
96 views

Field calculator (using ATAN)

How do I input the arc tan in the field calculator given the values of the fields to get the desired answer, I compare the answer of the manually computed arc tan value and the Atan Spatial Analyst ...
1
vote
1answer
51 views

Calculating a z value in python

I have some contours where the z value is stored in the geometry and I want to display it as an attribute. I want to include this in a python script. I have an expression which does this in python ...