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
0answers
30 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
44 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 ...
2
votes
1answer
17 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" ...
4
votes
0answers
34 views

How to update null geometries from an attribute

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
25 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
89 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
29 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
32 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
122 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
65 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
43 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 ...
3
votes
1answer
31 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
3answers
70 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, ...
1
vote
1answer
57 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
44 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
529 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
43 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
183 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
31 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
26 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
117 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 ...
1
vote
2answers
267 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
2answers
160 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 ...
1
vote
1answer
661 views

Calculate field in model builder using file name

I have browsed answers to similar questions but I still cant figure it out. I have created a new field called "namemonyr" in all of 646 shapefiles. I now want to populate that field using ...
1
vote
2answers
70 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
53 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 ...
0
votes
2answers
81 views

Why does script only work if run twice? [on hold]

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

calculate value using maximum value from different feature class

I'm trying to get the maximum numeric value from one feature class and use that value in an expression to calculate values of a different feature class. fc2.bldg_id = max(fc1.bldg_id)+1 Can this ...
3
votes
3answers
48 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
21 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 ...
0
votes
2answers
34 views

running scripts of codeblocks in arcpy with syntax error

I am having a trouble in running the following scripts: import arcpy arcpy.env.workspace = r'C:\MyData\my_geodatabase.gdb' max = 123 min = 0 mean_s = 12.3 expression1 = "test(!mydensity!)" codeblock1 ...
10
votes
3answers
301 views

Field calculator: Calculate sum of parts of column, based on another column

I would like to calculate the sum of values in one column, based on values in another column. To illustrate my question I uploaded the picture below. The second column consists of zipcodes, the third ...
1
vote
1answer
24 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 ...
3
votes
3answers
2k 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 ...
2
votes
4answers
111 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
38 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
48 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 ...
2
votes
3answers
3k views

Python script for identifying duplicate records (follow up)

I am trying to calculate a field that marks duplicates and sequentially numbers them. I am using the code below that I found here: Generating sequential numbering for duplicate values in a field ...
2
votes
1answer
67 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 ...
1
vote
1answer
59 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
44 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 ...
0
votes
1answer
65 views

Populate Integer Field based on Text Field

Using ArcGIS 10.2.2 In the picture below, I want to populate the Spd_Class field (short integer). The value of the Spd_Class attribute will be based on the TYPE field - residential = 30 secondary = ...
0
votes
1answer
29 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 ...
2
votes
2answers
64 views

Can the formula used to calculate a field in a QGIS attribute table be viewed after it was run?

I have a .shp which had undergone some edits to the attribute table a while back. A formula was used to recalculate some of the field values. I now don't have access to the knowledge of how these ...
1
vote
2answers
104 views

Field Calc to change one digit in a sequence Arcmap

I have an 11 digit ID in one field I'll call "Current_ID". I would like to create a new field named "New_Field" and populate it with same value except I need to change the value of the 4th digit from ...
2
votes
1answer
41 views

Dealing with zeros while iterating a model for percent change

I'm using ArcGIS to examine some aquatic vegetation changes over time and I have created a model that adds two fields: Area_percentLoss and Biomass_percentLoss. My model is iterating over feature ...
0
votes
1answer
44 views

Getting “real time” occurence count of values in attribute table for displaying purposes

I'm working with ArcMap 10.2 on a layer of points that I have to move. I'm using the editor to move them. What I also need is to display these points based on how many are sharing the same coordinates ...
1
vote
1answer
504 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. ...
0
votes
1answer
748 views

Null output from field calculator code block

I have a simple calculation to compare two columns and populate a new column with the lower value but I am getting null output...any ideas? expression ...