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 ...
9
votes
1answer
4k views

How to fill my column with consecutive numbers

I'm very new to QGIS, so forgive this simple question. Searching in older topics didn't help either. So: I make a new column in my attribute table and it has a default value (for example 0). I want ...
1
vote
2answers
880 views

Counting Characters using Field Calculator - Arcmap

I am trying to use field calculator to populate a column based on the the number of characters in another column. I am using the Python Parser. I am not sure if the .count() function is appropriate in ...
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 ...
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 ...
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
2answers
325 views

Extract string between special characters - and / into a new field ArcGIS Field Calculator

Can I create a field calc expression in ArcGIS 10.3 to print a selection between special characters? I would like to extract a selection of string from field [FolderPath] to a new field [Name]. The ...
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 ...
10
votes
1answer
11k views

How to perform If Statement in Field Calculator of ArcGIS for Desktop?

I have a shapefile containing two numeric fields ("Dist_1" and "Dist_2"). I want a Field Calculation that will populate an additional field ("Result") with one of three answers: First if Dist_1 is ...
6
votes
3answers
184 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 ...
0
votes
1answer
82 views

Replacing values in multiple columns using QGIS Field Calculator?

In QGIS I want to search for a specific case and if this is true then replace the text in multiple columns. Based on Use updatcursor to replace values in multiple fields, Update multiple ...
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 ...
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, ...
6
votes
1answer
150 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 ...
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 ...
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 ...
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
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, ...
2
votes
3answers
59 views

Stacking multiple selected points in ArcGIS

I would like to find a way to stack multiple selected points in ArcGIS, either using the field calculator or python script. For example, I want to snap all points representing houses on a street into ...
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 ...
1
vote
1answer
444 views

trouble with code block execution in python script

I am trying to calculate values for a field in a python script, but keep getting an error that I don't understand: ExecuteError: ERROR 000539: Error running expression: Fron000000F1 Traceback (most ...
1
vote
2answers
313 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 ...
3
votes
1answer
2k views

How to copy values from field to another using arcpy?

Can some one please let me know how I can do simple field calculation like Copying From "A" to "B" in ArcPy? I have found lots os example on web which they all used extra expression and they were ...
1
vote
1answer
524 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. ...
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 ...
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 ...
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" ...
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 ...
3
votes
2answers
124 views

assign a number for each group in field calculator

I have several thousand features each of which has a name. The names are not unique. what I want to do with the field calculator is assign a number to each name so I can refer to a number and always ...
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 ...
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 = ...
0
votes
1answer
45 views

Creating IDs for multiple features in Python Parser of ArcGIS Field Calculator?

Does anyone know how to create ID numbers for multiple features using python? For example; (IDs being the object ID, Name and object ID being two different fields) Names //// IDs Street 01 River ...
2
votes
3answers
546 views

Updating column in Field Calculator using values of another column?

I am very new to GIS, so I hope to get some help. I am using ArcGIS 10.2 for Desktop. I want to create a new numeric column on my attribute table to store "seasons" in numbers. For example, I want ...
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 ...
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 ...
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. ...
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 ...