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)

2
votes
1answer
21 views

Python to create new fields in many layers / QGIS

I have a number of line layers on which I need to perform the same task: add 4 columns with the start and end points of each line. The expressions that I use to do this are: $xat(0) $xat(-1) $yat(0) ...
4
votes
0answers
22 views

How to undo field calculation in ArcGIS Pro

I am using ArcGIS Pro and cannot find a way to undo field calculations. With ArcGIS, field calculations could be undone when an edit session was active, but Pro seems to be in a perpetual edit ...
1
vote
1answer
30 views

ArcGIS Calculate Field, Python Shape Expression

Using ArcGIS 10.1 and Python 2.7- I am trying to write an expression that calculates the mid point of a line. I've tried many different expressions, but I continue to get syntax errors. #An example ...
0
votes
0answers
11 views

How to accommodate hyperlinks that have a changing date?

I have an installation with close to 400 building, when I click the identify tool in ArcMap 10.3 I would like to be able to select a hyperlink that takes me to a floor plan PDF. All the floor plans ...
2
votes
1answer
30 views

Using ArcGIS Field Calulator with VB Script

My code looks like the following: if [LWS50yrp] <136.5 then [DMG_50y] = 0.1 elseif [LWS50yrp] >=136.5<154 then [DMG_50y] = 0.15 elseif [LWS50yrp] >=154<166 then ......
2
votes
3answers
215 views

How to use field calculator to change values from a,b,c etc. to 1,2,3 etc.?

I have a vector shp with a column with string values. How can I convert this to a column of integer values in another column but keep the categorization: e.g. from: col1,newcol2 A, A, B, A, C, to: ...
0
votes
1answer
51 views

Unable to calculate field correctly using ArcPy

I am attempted to calculate a field in a feature class ("Feat_Class_1", by using the count of selected features within another feature class ("Feat_Class_2") as a numerator, while using the value of a ...
3
votes
1answer
41 views

An equivalent for field statistics for records

I know how to obtain various statistics for a field, or "column", in an attribute table in ArcGIS. Is there any way to obtain a Mode figure for records, or the "rows" in a table? For instance, an ...
1
vote
2answers
44 views

Parse multiple field in field calculator using python

I'm trying to fill a blank field depending on the contents of three other fields using python in the field calculator. Sample code is something like: def getClass(Text1,Text2,Text3): if Text1 is ...
1
vote
1answer
86 views

How to Edit Field using VBscript or Python in Attribute Table

I add a field called Name in attribute table in arcgis 10.1 but I can't edit this field. From this site, I have learned that this can be done by field calculator using VBscript or Python. As I have ...
3
votes
2answers
107 views

How to extract part of string after '*', '~', '-' or '#'

I have strings like this: 234/1-1 3345#5 11/2~10 6754*15 It needed only rightmost part of string after '-', '#', '~'or '*' . I figured how to extract when there is only one sign for example '~' ...
1
vote
2answers
58 views

How do I calculate a field to be equal to another?

How can I calculate the StreetNames field to be equal to the values in the TEMP field in the below feature class attribute table? I am working in a file geodatabase in ArcMap version 10.1.
0
votes
1answer
28 views

Calculate Acos in ArcMap

I am trying to calculate acos in ArcMap (shp) using Python. Here is the code: arcpy.CalculateField_management(fc_Arcs, "Angle", math.acos(0.88), "PYTHON_9.3") If I set the value i.e. 0.88 I am ...
1
vote
1answer
18 views

How to calculate specific rows in layer field- ArcGIS 10.3

I try to calculate specific rows (OBJECTID 23-29) in "field_name" field with field calculator- i try to fill in the value "rt8". This is the attribute table: but i can't find any option to ...
1
vote
1answer
31 views

Using Field Calculator to assign consecutive numbers to a field based on attributes in another field

I am trying to assign consecutive numbers to a numbers field using Field Calculator so that all my 500 features have unique label values, however some features have multiple polygons and therefore ...
3
votes
1answer
49 views

ArcGIS Field Editor if/else syntax with python

I am just starting with Python and ArcGIs so here is my question: I have the column "DB_Low" (Type "Long") and want to fill a new column by changing values. The new column will be a Float-Type field. ...
4
votes
0answers
84 views

Raster calculator creates strange output

I am trying to combine two raster layers (one is nighttime satellite data, the other is the GPW population density data). I am using raster calculator to combine the two (the following is for a ...
0
votes
0answers
23 views

Calculating and replacing Nulls with String In same filed using ArcMap Field Calculator?

I have a FC contain a field that has 2 values, Null and String (String values have been repeated and all have similar Name, i.e. 'Saturday'). I would like to use the Field Calculator to recalculate ...
1
vote
1answer
19 views

XY_LINK field using Point_X & Point_Y Fields

In the below image, I am trying calculate my XY_LINK field to return the values from Point_X and Point_Y field. Example of final result: {2474785.499662}{376075.063004} My code is as follows: ...
3
votes
1answer
38 views

Adding certain number for each community with QGIS field calculator?

I have a big data with the parcel numbers of different communities. Now I want to join the parcel numbers of the attribute list with an excel table. Since they need to have something in common to ...
11
votes
1answer
194 views

QGIS, Populate field with self-updating formula (like spreadsheet)

Is there any way (plugin, or otherwise) to put a formula as the value of a field, which would then self-update as the other fields it is based on are adjusted? Exactly the way field-calculator updates ...
0
votes
1answer
45 views

ArcGIS - if clause in the field editor with python

I have 2 columns in my table. "dB1" and "dB2" Now I want to calculate a third columnn "dB3" depending of the entries in column "dB1" and "dB2" if "dB1" or "dB2" have an entry of "0" I want to ...
4
votes
3answers
240 views

How do I say “use the value from the same row” in Field Calculator?

I have an attributetable with several columns. I want to change the values of column1 if they are NULL with the values of the same row in column5. case WHEN column1 is NULL THEN END How do I say "...
1
vote
1answer
35 views

Arcpy Freezing on Field Calculation

I am trying to populate a grid with the number of features in each grid cell. I've gotten this script to work with a subset of the data, but when I try to run it on the full (52,000+) cell feature ...
3
votes
1answer
61 views

Replace non-ASCII characters in QGIS Field Calculator

I want to replace all non-standard characters from fields in a dbf table in QGIS. From http://stackoverflow.com/questions/20078816/replace-non-ascii-characters-with-a-single-space I see we can use ...
1
vote
2answers
33 views

Calculate text field using python script and keeping preceding zeroes

I'm trying to calculate records in a text field to "01", keeping the preceding zero in tact using python script in ArcGis. I can do this easily using the field calculator in ArcMap or the calculate ...
1
vote
0answers
23 views

Creating a new field based on another field and proximity to another shapefile? [closed]

I have a shapefile (sf1) with speed and another shapefile (sf2) with road locations. I'm trying to create a new field in sf1 that denotes commuting, so a binary 0=not commuting;1=commuting. I created ...
3
votes
2answers
45 views

Tiny difference of calculated area of polygons

I have a shapefile of about 62.000 polygons. I calculate the area of each polygon on a field, named AREA1, with Calculate Geometry option. Secondly, I create a new field field named AREA2. I calculate ...
7
votes
3answers
220 views

Remove multiple characters from string field using field calculator (python parser)?

Is it possible to remove more than 1 character from a string in a field using the field calculator? I know !file!.replace(" ","") removes spaces in a string, but is it possible to remove spaces ...
1
vote
0answers
29 views

Grid interpolation using a new calculated field

Still learning.... I am trying to run the grid interpolation tool on a point shp file. I can successfully use the tool with the existing data but cannot run the tool on a new field I created in the ...
3
votes
2answers
198 views

Calculate sequential numbers into sorted table

Is there a way to calculate a sorted field with sequential numbers? I have seen a post that outlines how to calculate sequential numbers, but this is always calculated on FID order, not on sorted ...
0
votes
0answers
31 views

Extract characters from an existing string field to create a new field

I have a string field named CHESS2016_N94S_FL1_C__20160407230029.562GMT_COLOR-8-BIT.JPG and I would like to select characters 16-18 to populate a new field. I've been trying to use the field ...
3
votes
1answer
71 views

QGIS find and then replace value in multiple columns

This is based on a previous question/answer that I had. QGIS -replace values in multiple columns I need it to update 3 fields now and I get an name 'e' is not defined error. What have I done wrong? ...
2
votes
0answers
31 views

Using ModelBuilder to calculate field in a point dataset based on polygon dataset?

I am attempting to take stormwater point and features and calculate a field "SUBBASIN". The subbasin layer is several polygons of a stormwater basin. In the point feature, I am trying to calculate the ...
2
votes
1answer
46 views

field map string values in one field to domain field

Is there a method in ArcGIS 10.3.1 to calculate coded value domains in a domain field based on a string field source? Please see image. The solution appears to be to use the CalculateField GP in ...
4
votes
1answer
96 views

Using Python strip and split functions in ArcGIS Field Calculator?

I am trying to populate a field with the last word in an address string using field calculator within ModelBuilder. My code takes the whole address string (1234 S Brittany Town Dr) as a parameter, ...
3
votes
1answer
99 views

Calculate Field using variable in arcpy

I've got a problem with my script and hope that someone can help me. What I´d like to do is using the field calculator to calculate values for a field using values from another field and a variable ...
2
votes
0answers
48 views

QGIS graphical modeler calculator

My question is about the calculator in the QGIS graphical modeler. I explain my problem issue first: I want to build a modeler that creates buffers around layers and makes a selection on a second ...
6
votes
1answer
188 views

How to make a automatic updated date and time field in QGIS 2.14?

I want to make a date and time upadated field as I edit an attribute field in this format yyyy-mm-dd 00:00:00 (= 2016-05-08 11:04:00) - my local date/time. The data is in a QGIS 2.14 shapfile and ...
1
vote
1answer
26 views

Using Title Case on Everything Except Last 2 Characters

I have addresses in my attribute table that I converted to title case from upper case. Example: 123 FAKEVILLE ST NW to 123 Fakeville St Nw How can I make it so that the last 2 characters in all ...
6
votes
2answers
133 views

Is there a way to assign row number for sorted table by column in QGIS?

Field calculator has a great function under "Records" called "$rownum" which returns (assigns) the number of the current row. Is there a way to make it work together with sorting? Lets say I want to ...
1
vote
0answers
50 views

Populating an attribute field using calculations based off fields of another feature class

I have hundreds of 'agriculture' polygons in one feature class, and each polygon is surround by numerous 'margin' polygons in a separate feature class. What I would like to do is select all the '...
3
votes
1answer
27 views

QGIS: Error message in query builder

I am using QGIS version 2.14.1 (Essen) and trying to update data in my table using field calculator. I am inputing the following statement: update "table_1" set "table_1" ='y' where "table_2" ='...
5
votes
0answers
43 views

How to update null geometries from an attribute [duplicate]

I have a large point feature class and have realised that there are several hundred features with null geometry. Fortunately the coordinates are stored as an attribute. So What I need to do is update ...
2
votes
2answers
56 views

Parsing new field into calculate field

I have a pivot table that has 11 ShipTypeGroup fields with "Long" field properties that cant be divided by 12, due to decimal places. Therefore I am trying to create a new field, copy attributes ...
1
vote
1answer
29 views

ArcMap function in field calculator not working

Trying to return everything except the last element in a field after splitting it. Using ArcMap 10.2.2 in the field calculator. !ST_NAME!.split(" ")[:-1] This returns a null value in attribute ...
4
votes
1answer
103 views

Using ArcGIS Field Calculator to populate new field from old field

I'm trying to assign speed values to street types using TIGER street shapefiles. So I created the new field for the speed, and I was going to use the field calculator to take the MTFCC classifications ...
1
vote
1answer
41 views

Calculating population density from urban raster reclasiffy

I am using ArcMap Out of a raster, I reclassified it into only having the urban areas. I ran this through zonal statistics and got the area of the urban area (in meters, which I presume are in ...
3
votes
0answers
42 views

Translating ArcGIS field calculator python expressions in to QGIS field calculator python expression?

I'm transitioning to QGIS from ArcGIS. I'm having trouble getting my python field calculator expressions to work in the QGIS advanced python field calculator. Here is a screenshot of the working ...