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)

1
vote
1answer
36 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
43 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
32 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
147 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
34 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
24 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
62 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
34 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
44 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
37 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 ...
0
votes
0answers
12 views

How to get 1st and 2d vertical derivativ from gravitational survey? [closed]

I have a bouguer anomaly map and i want to do a vertical derivativ on it so i did 2d fft on gravity data then i used this equation : A(u,v)=A(u,v)*(SQRT(u^2+v^2)/n)^n after ...
1
vote
1answer
41 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
76 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
49 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
67 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
28 views

Network Anlayst hierarchy evaluator [on hold]

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
267 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
72 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
42 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
29 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
75 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
195 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 ...
1
vote
1answer
51 views

Attribute table not updating after QGIS field calculator used? [closed]

Using QGIS 2.8.1 i am trying to update an attribute table using the field calculator. its a vector layer of vegetation communities. i am trying to update the area fields in the table. The output ...
2
votes
3answers
100 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. ...
1
vote
1answer
39 views

Concatenating fields while also replacing values within certain stings [closed]

I am trying to use python to concatenate multiple fields in a polygon layer. Specifically, I am attempting to combine the values of four fields into one: EXPCODE = !MATRIX! & !PLANT! & !PCT! ...
2
votes
2answers
54 views

How to convert negative field values to positive?

I have an xyz file that I want to convert negative field values in the z column to positive values. How do I do this with field calculator?
2
votes
3answers
58 views

How do I use the field-calculator in QGIS to return the name of a country from a different shapefile?

I have a shapefile that consists of a list of archaeological sites with the x and y coordinates. I have an Natural Earth shapefile for the countries of world. I was wondering how I go about ...
0
votes
1answer
24 views

ArcGIS do calcuation on multiple input fields of attribute table and the number of input fields is changing

I have attribute table with headers: ID(bgrp), F1 (F2011_46), F2 (F2011_48), ...Fn I want to do math calculations on the fields from F1 to Fn. For example, count the total number of non-zero Fn ...
1
vote
0answers
18 views

Incorrect Acreage QGIS 2.6.0

I have six polygons, all of (fairly) similar size. The first one is 8 acres, the others are obviously wrong with 120,000 acres, and 106,000 acres and so on. I am calculating with the field calculator, ...
2
votes
1answer
25 views

Polygon shapefile field calculator problem

My project is set in WGS84 only, and I have checked 'enable on the fly'. I have created a polygon shapefile and my problem is that when i use field calculator in the attribute table on my polygon ...
0
votes
1answer
24 views

Raster Calculator or Local-Combine tool? (in ArcPy)

i have 3 classified rasters and i wanted to use the following query from r. calculator: (rclslope>=45) & (rclmosaic>=2000) & (rclfocal>15) to arc.py how can i write it? Is it ...
0
votes
4answers
99 views

Concatenate string data plus numeric data in Arcmap 10.2.2

I have three attribute fields (Address_No: 1, StreetName: Main, Street_Ty: ST) that I want to merge together. How do I concatenate string data found within the table plus numeric data? I would like ...
1
vote
0answers
30 views

Systematic inaccuracy in QGIS shape area

I’m trying to find out why I get different area figure in QGIS than in AutoCAD when I’m using the same shape file? What I did is I drew a shape in AutoCAD, imported it in QGIS and used the field ...
1
vote
1answer
33 views

How can I allocate a $rownum in reverse order in QGIS?

How can I allocate the $rownum value in reverse order in QGIS? I have a created a grid layer to use in an atlas and the ID allocated is from top left to bottom right - which is what I want if I want ...
1
vote
3answers
61 views

Calculate field management not working within customized Python tool in ArcGIS

I am trying to make a custom made Python Script tool which I would like to use in Model builder. I am using the arcpy.Calulate_field_management function (simple reclass function as an example), but it ...
3
votes
2answers
184 views

VB Script or Python for Field Calculator when using greater/less than?

What I have: I have 4 fields for my address ranges. L_ADD_FROM, R_ADD_FROM, L_ADD_TO & R_ADD_TO (all in DOUBLE field type). What I need: The lesser value from L_ADD_FROM and R_ADD_FROM to ...
0
votes
2answers
88 views

ArcGIS field calculator: Calculating a new field using multiple fields with python

Basically, I have a large polygon data set that has soil data for an area and I want to assign numeric values to the data based on soil texture text values (e.g. SIL=4, CLY=7, ...). However, the soil ...
3
votes
2answers
137 views

How to calculate a value based on another field under arcpy.da.UpdateCursor and cursor.updateRow?

I am trying to do a calculations under arcpy.da.UpdateCursor. I want to calculate the values for the records that have FIPS=06037. I want to take the values from "kg" column and populate the new value ...
1
vote
1answer
51 views

Calculate field based on other two added fields in ArcGIS Model Builder

I have a model in model builder where I add 2 fields, "field 1" and "field 2". For each field I calculate their values using the calculate field tools. Afterwards I add a third called "Field 3" of ...
0
votes
2answers
61 views

Use Python in Field Calculator to increment up value

Please see screenshot for field calculator Python logic. I have no idea what I'm doing that's any different from this GISSE answer. The error I receive is ERROR 000989: Python Syntax Error (invalid ...
1
vote
2answers
126 views

Cannot convert string to int using ArcPy Calculate Field

When I load a csv file to join with ArcPy, it converts all string fields that are numeric to integers. Therefore, I have to add another field within the feature class that I'm using for joining that ...
1
vote
1answer
47 views

new layer from calculations with fields of other layers in QGIS

I've two layers, both with the same fields: A, V, where A is the shape's area and V a value given by me. I want a new layer with shape created by the intersection of the other layers' shapes and a ...
2
votes
1answer
24 views

Create field on open ArcGIS map - not saved

I am using ArcGIS desktop with an SDE feature layer with enterprise data that I do not have rights to edit. The data changes weekly but I need a field that is sum of 2 current fields without creating ...
0
votes
1answer
63 views

if/then with VBScript in ArcGIS Field Calculator giving Error 000539: SyntaxError: invalid syntax?

What is wrong with this VBscript in the field calculator? ColumnC= if [ColumnB] > 0 then [ColumnC] = [ColumnA] / [ColumnB] endif Each time I receive this syntax error message: Error ...
1
vote
0answers
47 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 ...
2
votes
1answer
134 views

ArcGIS Python syntax error using nested if else

I am trying to use the field calculator in ArcMap 10.2 to fill an empty field based on the contents of two exiting fields usint this python script in the Pre-Logic Script Code. def ...
0
votes
0answers
58 views

Line length for line files

Using QGIS, Brighton 2.6. Trying to calculate line-lengths for linear features (roads, trails, fenceline) and used this post (How to find line length in QGIS while editing?) and the links associated ...
1
vote
2answers
153 views

Using Python in the field calculator - if/else over multiple fields

I'm trying to work out how to populate a field depending on the lowest score across 6 other fields. I've read several other questions relating to if/else statements but I'm only just starting to learn ...
1
vote
2answers
82 views

Setting field equal to raster Name ID for batch process in ArcPy

I am wanting to set an existing field called RasterID to the name of the raster for which the attribute table belongs to, but for a batch of rasters. Is there a way to do this with my current code ...