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)

4
votes
1answer
59 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
32 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
22 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
38 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
45 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
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
94 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
31 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 ...
1
vote
3answers
44 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
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 = ...
1
vote
3answers
76 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
46 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
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
28 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
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 ...
3
votes
1answer
184 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
71 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
54 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
118 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
82 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
60 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 ...
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 ...
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
49 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
60 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 ...
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 ...
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
65 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
106 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 ...
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 ...
5
votes
1answer
102 views

Field Calculator text field to new shapefile

I have point features being selected by a polygon feature and copied to their own shapefile. I also have certain values of the polygon feature being applied to the newly created point file. The ...
1
vote
1answer
31 views

VBScript, Error 999999 Syntax Error Calculate Field in ArcGIS

I am using a field [all scores] as a parameter agricultural classification. I tried using field calculator (VB script) with many kinds script, but it never works and giving me notification 99999, ...
1
vote
1answer
52 views

Combining information from multiple rasters into aggregate raster and populating fields accordingly

I am stuck on how to best combine the information from multiple rasters into one raster. Specifically, I am working with a time series of raster files, whereby each raster corresponds to a different ...
2
votes
2answers
36 views

Calculating a field in modelbuilder

I am trying to update attributes in a table using Calculate Field in Model Builder. I have used the following bit of code but its not updating the field. expression: Change(!Zone!) def ...
0
votes
1answer
60 views

QGIS -replace values in multiple columns

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 ...
2
votes
1answer
46 views

Concatenate fields in Field Calculator using Python [duplicate]

I'm trying to concatenate fields together and used this post as a guide: <Adding hyphen in ArcGIS Field Calculator to merge two columns?> ; however, I'm still getting a 989 parsing error. Here's ...
3
votes
2answers
36 views

Name of field in ArcMap Field Calculator window

A few days ago I was answering Comparing two fields and printing result as 1 (if number matches) or 0 (if not) using Python Parser of ArcGIS Field Calculator? When describing the process required ...
1
vote
2answers
58 views

Comparing two fields and printing result as 1 (if number matches) or 0 (if not) using Python Parser of ArcGIS Field Calculator?

I have two fields named as "sample no" and "data_all" trying to find out whether "sample no" exist on "data_all" or NOT. Using field calculator python 9.3. if exist print 1 if not print 0 in check_in ...
1
vote
1answer
68 views

Calculating angle between polyline segments and assign this value to point?

I have a polyline feature with many segments (polyline splitted at vertices). I plan to record angle values to attribute table per each polyline segment and assign it to point features. I need to ...
4
votes
2answers
117 views

How to concatenate two fields (type double) into a single field?

In arcgis 10.3 using the field calculator I'm trying to concatenate a census tract field (double) with a census block field (double) into a single field that has the two values separated by a decimal ...
2
votes
3answers
74 views

Selecting max value of a select by location with ModelBuilder and Python?

I am new to ModelBuilder and Python scripting. I am trying to create a model which selects each feature within a dataset, uses a select by location to select all features within a 50m radius, and ...
3
votes
1answer
33 views

Conditional Statement in QGIS Field Calculator

I'm using QGIS to calculate total loss in an earthquack attack. I wrote this expression in Field Calculator. CASE WHEN "build_type" = 1 AND "MMI" < 5 THEN "perc_loss" = 0 WHEN ...