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
0answers
11 views

Populate field by numbering different types of roads using field calculator [duplicate]

I am trying to populate the Func_class field by numbering each type of road in my attribute table. I have different road types such as 'secondary road','local road','main road' see picture etc I ...
0
votes
2answers
42 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 ...
1
vote
1answer
35 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 ...
1
vote
2answers
48 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
31 views

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

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
46 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 ...
3
votes
2answers
87 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 ...
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
52 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 ...
2
votes
2answers
60 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
40 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
36 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? ...
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 ...
1
vote
3answers
44 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 ...
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
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 ...
3
votes
0answers
52 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 ...
0
votes
1answer
40 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
38 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
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
50 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 ...
0
votes
1answer
41 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
212 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
64 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
35 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 ...
0
votes
1answer
47 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
59 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
66 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 ...
1
vote
1answer
57 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 == ...
2
votes
2answers
171 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)
2
votes
1answer
65 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 ...
0
votes
1answer
34 views

Combine string and OBJECT ID

I would like to update the Map_Feature_ID field with a String " WP_" and then follow the "WP_" with the OBJECTID field. So I will end up with "WP_1", "WP_2" all the way to the end in the Map Feature ...
-1
votes
1answer
84 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 ...
1
vote
1answer
36 views

Coordinates for specific points calculated in QGIS Field Calculator?

I have got a layer in QGIS that is comprised of connected points which define regions of a country, thus the attribute table consists of 38 regions while the number of nodes in this layer is about ...
0
votes
1answer
56 views

Using Python parser of ArcGIS Field Calculator to populate values in one field based on those in another?

I am trying to populate a field with a sorting code that represents the value of another field. Example: EXPCODE|SORT| S4DNN2 |3.5 H2BNN2 5.0 EXPCODE is a field with a value like "S4DNN2." SORT ...
1
vote
1answer
49 views

Getting and using XY centroids in ArcGIS Field Calculator using Python Code Block

I am writing a script to obtain Grid reference but cannot fathom how to get XY centroids without creating new fields (all examples I have found are based on writing XY centroids to field). Here's ...
1
vote
1answer
46 views

Using defined function code block with Python in ArcGIS

I am running a Field Calculation within a Python script in ArcGIS. Within this Field Calculation I am calling a defined function within a code block. Here is the dialogue that I ran and works: ...
2
votes
2answers
92 views

How to add multiple python expressions in field calculator

How would I add multiple python expressions in the ArcMap Field Calculator if possible? I tried separating each expression on a new line and also separating with a semi-colon but neither worked. ...
1
vote
2answers
55 views

How to add “0” to multiple parts of text value in Field Calculator with Python

I have values in a text column that are as follows: 000_100 100_200 ... 1000_1100 1100_1200 I want it to read: 0000_0100 0100_0200 ... 1000_1100 1100_1200 I want all values to have the ...
0
votes
1answer
79 views

if-else logic expression in field calculator

I want to calculate the value of a new field using an if-else condition with field calculator in modelbuilder. Want I want to do is as follows: if my new field is empty, then use the expression ...
0
votes
2answers
47 views

in attribute table [closed]

Rows consist of letters and numbers that had 6 strings expression. I want to group these rows according to at least 3 strings be similar. How can I do?
1
vote
0answers
31 views

Network Anlayst hierarchy evaluator [closed]

Working with ArcGIS (v10.2.2) Network Analyst and reformating the road network with a hierarchy evaluator and receive the following error message: The field evaluator result statement has multiple ...
1
vote
2answers
300 views

Calculate field

I am working in ArcMap 10.2 and would like to calculate a field. The output should be the value of 'field 1' only if 'field 1' has a value 0 or it should give the value of 'field 2'. How to do ...
1
vote
4answers
89 views

How to remove period, comma, symbols using field calculator?

I want to delete . , # in attribute table using field calculator (VB Script or Python). How can I remove these using this example address: N. First St., Unit #1 (I don't need city or state name) I ...
0
votes
1answer
48 views

Iterate through all fields in attribute table and multiply by field

I have a table with a whole bunch of census variables (race, age, education, etc). I want to multiply all of these fields by a factor that I calculated. For example: Field1 has values of 10,20,30,40 ...
2
votes
1answer
43 views

How to change GK-coordinates to UTM with the field calculator in QGIS?

i have a qgis project in ETRS89 (UTM) with some vectorshapes. i already transformes them from GK into UTM. but now the attribute table still show me the GK-coordinates. HOW can i change it? with the ...
0
votes
1answer
77 views

Problem with addιtion abstraction in Field Calculator

I want a bit analytical respond for the mistakes I have done in my code cause I am new to programming. I am using ArcGis 10.2. and I must process a field with distances in an attribute table I have. ...
4
votes
1answer
230 views

Converting 12-hour time to 24-hour time using Field Calculator

Does anyone know how to convert string time formats in ArcMap v10.2 from 12-hour to 24-hour using a simple query in the Field Calculator? i.e. NO Python, NO editing in Excel, NO changing my Windows PC ...