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
2answers
70 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
107 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
39 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
103 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
35 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
55 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
39 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
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 ...
2
votes
1answer
51 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
38 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
61 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
95 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
123 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
76 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
37 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 ...
5
votes
2answers
99 views

Why can't I multiply values from column named 'length' using field calculator via PyQGIS?

I want part of my plugin to multiple value of length and add it to table.Basing on this question: How to use QGIS field calculator in python? , I made script that works fine for some filed: I can ...
2
votes
1answer
28 views

Field Calculator unexpectedly results in integer or decimal, depending on input

In model build, I have the following Field Calculator tool running: You can see in the results below that when the calculation involves a decimal, the output shows 6 decimal points, but when the ...
1
vote
2answers
90 views

Rotate symbols perpendicular to line angle (ArcGIS)

I have lines representing curving streams (blue line in the Picture) and want to angle symbols perpendicular to the angle in their particular Locations (point features symbolized as red lines in the ...
10
votes
3answers
314 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 ...
4
votes
2answers
87 views

How do I use Python to edit a field in an attribute table?

I have a few data tables full of information on salt water injection wells, with injection volumes given on a monthly basis. I need to add these monthly values up in order to get an annual value for ...
3
votes
1answer
72 views

Calculate area of geometry derived from current feature in QGIS 2.8

I'm trying to create a new field defined as the area of the convex hull of the current feature, in the Field Calculator in QGIS 2.8. Calculating the area of the current feature is easy ($area), and ...
2
votes
2answers
47 views

ArcGIS10.2 Field calculator problem with strings

I am trying to do a simple concatenation using the ArcGIS 10.2 field calculator with Python code. I have a field of census tracts numbers (tract). I want to concatenate this with the numeric codes for ...
0
votes
0answers
15 views

Number of markers depending on attribute

Is it possible to have a line vector layer where the number of markers is dependent on a particular attribute? e.g. I have the attribute "number of X" which depends on $length (number of X = ...
2
votes
1answer
67 views

How to use the field calculator in QGIS to determine the total of differents fields

I have an attribute table with 7 fields. I want my attribute " A1 " to be the total of " IP1 to IP5 ". I am not familiar with the request in the field calculator. How can I calculate the value of ...
1
vote
2answers
84 views

Remove time stamp from date field using field calculator

I'm trying to copy the dates from a field called InspectionDate (date data type) to new field called CompletedDate (date data type) but I don't want the time stamp to be copied over. How can I copy ...
1
vote
1answer
49 views

Calculate field tool vs Field Calculator

I have successfully populated a field in Arc using the Field Calculator, however I would like to re-create this in python as part of a tool I am making. I was going to do this buy using 'Calculate ...
1
vote
0answers
73 views

Reduce Z value precision in QGIS

The .asc LiDAR files provided by the environment agency have height values provided to a precision of the level used to measure atoms. How to quickly lose a few of the pointless digits on the end to ...
1
vote
3answers
110 views

Script for Sum of Rows in field calculator - VB or Python?

I wrote the TOTAL_FREQUENCY values manually. But I want to automatically write this values with a script. Namely, I want to write sum of column 3 to all of the the column 5 rows. How can I do it with ...
4
votes
2answers
227 views

Correct SQL expression when looping different fields

I'm having trouble with the follow lines of code. Practically what I am doing is a 10 shapefile loop in which field represents the name of the field that I want to be calculated( the name differs by ...
3
votes
2answers
169 views

ArcGIS python “add field” and “calculate field” workflow

I am new in Python and I am creating a Script. I've crafted a functional code, but I'd like to know if there is an easier way to do it, just for curiosity (And learning new ways!). The purpose of ...
0
votes
0answers
38 views

Work values of a table in QGIS!

I have a table associated to a shapefile with the number of people who live in different villages and the corresponding city. I want to define a new shapefile with points located in the centroide of ...
2
votes
1answer
49 views

Field Calculator is not calculating selection from Make Feature Layer in arcpy

I am trying to use field calculator to calculate 3 different fields in python from a Make Feature Layer variable. It calculates the first field (MATERIAL_T) but then it doesn't calculate the second ...
1
vote
1answer
37 views

Multiple calculations with if then statements and NULL values

I'm trying to calculate a total demand in ArcGIS 10.2.2, stored in fields Demand1, Demand2, ... , Demand20. Some of them contain a numeric value. The others have a <Null> value. The sum ...
2
votes
1answer
51 views

get day and time from date field with time, with field calculator

I'm using ArcGIS 10.1 and have a field containing a date and time I need to get the day of the week based on my date field and also when the same field that contains date and time I need to do this ...
1
vote
1answer
43 views

Date different in field calculator using python method

I would like to calculate date different between two fields of date format. The idea is to know if Field_1 is greater than Field_2. My calculate code is something like this: def date(f1,f2): if f1 ...
1
vote
1answer
64 views

If then else Logical VBScript in ArcMap 10.3.1

I realize this question has been asked in its basic form before, but I've tried a lot of code samples on answers posed to similar questions on this site to no avail. I'd like to create a new field ...
0
votes
1answer
111 views

Replacing with Null in ArcGIS 10.3 [duplicate]

In ArcGIS 10.3 Desktop, how do you replace field values with Null using the Field Calculator without selecting the rows first? I'm able to select the rows that I want and calculate using the Field ...
4
votes
1answer
81 views

Using UNC pathname with Calculate Field tool in ArcPy?

This question is different to Using Calculate Field to fix hyperlinks in ArcPy gives Cannot use VB for services? which was asked previously because it is using the Python parser specifically, rather ...
1
vote
2answers
63 views

Using Calculate Field to fix hyperlinks in ArcPy gives Cannot use VB for services?

Getting an error while trying to script it, specifically "Cannot use VB for services." Snippet and VB code block as follows: Raw block (works within ArcMap): "\ftp\raw\YYYYMMDD\Files\Charles" ...
3
votes
2answers
154 views

Field calculator if and elseif statement with <Null> values in ArcGis 10.1

Trying to figure out how to get this "Headwater" column to indicate "Yes" (or 1) if the value of "NextDown_Copy" is "" and "No" (or 0) if it has any other value (eg. 7100381010). I attempted to ...
2
votes
1answer
83 views

Virtual fields are lost when duplicate layers

I've just upgraded to QGIS 2.12.3 - and hoped that the issue which was really time-consuming in 2.12. <3 could have been solved ... On duplicating layer - with tons of joined tables and virtual ...
0
votes
1answer
160 views

QGIS loop/iterator with python in function editor (field calculator)

I am trying to create a loop to rename the fields of my attribute table. The fields should start at 1 and increment by one until the end of the table (e.g. 1,2,3,4,5,...,n) my code on the python ...
10
votes
4answers
347 views

Need to find strings that contain the same word twice

I have attribute data with owner names. I need to select data that contains the last name twice. For example, I may have an owner name that reads "BENNETT MCCARL & ARNETTE BENNETT". I would like ...
3
votes
2answers
65 views

Field Calculator - conditional function and string variable?

I know this question has been asked before in different fashions, but I can't seem to get my python script to work despite looking at all the relevant questions I could find. I am simply trying to ...
2
votes
0answers
46 views

Finding and using mean and standard deviation value in field calculator

I am creating a field for a z-score of a particular attribute. This requires calculating the mean and the standard deviation for the attribute across all features. I've been using the statistics ...
3
votes
1answer
38 views

How to replace a directory using QGIS Field calculator?

I have a column called Hotlink full of incorrect directories and I need to edit them. They currently read C:/ABCD/filename.pdf and I want them to read C:/Maps/ABCD/ABCD/filename.pdf The script I'm ...
0
votes
0answers
10 views

Finding distance between consecutive points using ArcMap Field Calculator? [duplicate]

I am very new to ArcGIS but I am working on a data set consisting of GPS locations of radio tracked freshwater turtles. I am trying to find the distances between the points in order. Can someone ...
3
votes
1answer
105 views

QGIS Field Calculator functions

Using QGIS 2.12.3, within the Field Calculator "Geometry" section, there are certain functions, such as "area", that also have a corresponding term beginning with a dollar sign, i.e. "$area". I don't ...