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
31 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
43 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
29 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
18 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
1answer
33 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 ...
6
votes
3answers
185 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
27 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
169 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
28 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
68 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
23 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
42 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
77 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
88 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
37 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
151 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
21 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
112 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
45 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
23 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
42 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
53 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
27 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
100 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
38 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
39 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 ...
1
vote
3answers
47 views

How to use field calculator to create a field based on another?

I have a field called RTS (Range,Township,Section(typically looks like 153320 with each two digits representing)). Would like to transpose to Township Range Section. Example from above would look like ...
4
votes
1answer
36 views

Auto-generated field in ArcSDE for end user

The objective: Create a process where a coworker can open an .MXD, start editing, add a feature to represent a complaint, then add records in a related table to represent an inspection. Along the way, ...
1
vote
1answer
60 views

Recalculate fields value using ArcPy and Calculate Field tool?

Im not sure how to pass through a list of fields within the calculate field tool.I have a list of fields and each of them need to be divided by 1000. My code is as follows: import arcpy shp = ...
1
vote
3answers
92 views

Replace occasional Space with Underscore using Python parser of ArcGIS Field Calculator?

I am creating a model which will give me two string values, one which reads exactly what is in a field and another which automatically replaces any Space with an "_". I have used Calculate Value tool, ...
0
votes
2answers
47 views

Trying to use Python to clean up null/bad data in Lat/Lon Load

I'm using ArcMap 10.4. Trying to load a list of Lat/Lons and connect the surface hole and bottom holes with a line connector (Toolbox XY to Line). I have two issues: 1) Values which have BHL and ...
0
votes
1answer
32 views

Using elif statements in Python parser of ArcGIS Field Calculator?

Looking for some help. I have a continuous variable (PCT_B100P) of the percentage of folks in a census tract that are under the 100% federal poverty line. I'm trying to use this variable to assign a ...
3
votes
3answers
29 views

How do I calculate average in my field calculator within specified limit?

I would like to calculate the average, max and min of each trips that I have. Each trips are also predefined (e.g. Trip 1, Trip 2) in the attribute table. (As below). I have more than 2000 trips. ...
2
votes
2answers
68 views

Field Calculate to remove certain values in field

I have a field named "ZIP" which has the zip code information for numerous records. Some of them have 9 numbers, but I only want them to have the first 5. What should my Pre-Logic Script look like to ...
3
votes
1answer
186 views

“ ”.join(list) not inserting spaces when calculating field

I have a Python script where I'm trying to take the values from three fields (street address data - direction, street name, street type) and combine them into one field, e.g. S, Main, St should be S ...
1
vote
2answers
80 views

Arcpy Calculate Geometry (coordinates)?

Does anyone know if it is possible to Calculate Geometry with Arcpy? I need to replicate the command > Right click field and Calculate Geometry except with Arcpy as I need to integrate this into my ...
1
vote
1answer
55 views

Calculate Field not saving on joined layer

I'm joining a table to a layer file, calculating a field in the layer and then removing the join. The code below runs with no errors, but when I check the field in the attribute table, nothing has ...
3
votes
2answers
127 views

Calculate Field - getting the code value but not the description

If STREETNM value are blank or _ then I want to replace them with the value of ST_DESIG. My code below returned the code value of ST_DESIG but not the description. How can I get the description ...
0
votes
2answers
84 views

Why does script only work if run twice? [closed]

I have a simple script that I'm running as an ArcGIS tool that adds three fields and then calculates the fields based on expressions that derive information from existing fields. I'm struggling to ...
4
votes
3answers
76 views

Remove decimal points from string field using field calculator

I have a string field populated with shape lengths in my attribute table but they have 12 decimal points. How do you remove decimal points from a string field populated with numbers using the field ...
1
vote
1answer
22 views

ArcGIS 10 Split string from OSM data

maybe you can help I have a string: "width"=>"6","name:be"=>"Калінавы завулак","name:ru"=>"Калиновый переулок","surface"=>"asphalt","int_name"=>"Kalinavy zavulak","maxspeed"=>"40" necessary as a ...
1
vote
1answer
27 views

ERROR 000539: Invalid Field !FULLNAME!

I am very new to Python and my first attempt hasn't gone too well. I'm trying to overwrite a field that is a spatial join of a couple of features in order to, in the end, generate a beginning and ...
2
votes
4answers
120 views

Setting up Concatenation using Python expression in field calculator?

I am having trouble creating a Python expression in Field Calculator in ArcMap 10.3.1. I’m attempting to concatenate two field values (double and short integer) to a third (double) field, (CON_IN). I ...
2
votes
1answer
45 views

Inserting substring in ArcGIS Field Calculator

Trying to use the split tool in ARCGIS to add an underscore. Trying to make "ABC11111" look like "ABC_11111". Don't have much experience using Python or VB Script but this is what I have created with ...
2
votes
1answer
50 views

Referencing other points(rows) in field calculator

I'm trying to calculate an angle between points using a field calculator. Is it possible to reference the previous or next FID with reference to the current one using the field calc? Eventually I'd ...
1
vote
1answer
20 views

Categorize on difference between max and min value for features with same attribute

I have a points layer. Some points have the same value in FIELD_1. I want to give different colors (value in FIELD_3) for different sizes of ranges of values in field FIELD_2 among points with same ...
1
vote
1answer
64 views

Python/VB Script Field Calculator

I'm new to Python/VB Script and am needing some help. I have tried several different If/Then statements but can't seem to get it straight. I am hoping for some help. I have 3 fields. ZONING, ...
1
vote
2answers
51 views

How to populate one column of a table by extracting the match of a Regular Expression?

I Have a CSV table where one of the columns has names of the post offices with the type given in brackets like this: Sri venkateswara puram (Sub Office) I want to extract the post office type, by ...
2
votes
1answer
71 views

How to use QGIS advancedpythonfieldcalculator from the console?

I'm trying to use the field calculator in a script like so: processing.runalg('qgis:advancedpythonfieldcalculator', output_layer, 'Latitude',1,12,5,'','$y',output_layer2) Not sure exactly how to ...
0
votes
1answer
30 views

Averaging multiple values to a single value by common field ID

I want to see how accurate/representative a centroid's datapoint value is compared to averaged multiple datapoints values for the same polygon. There are MANY polygons in the same shapefile. I have a ...