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)

0
votes
1answer
110 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 fields/...
2
votes
1answer
55 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
46 views

Describing input 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
64 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 ...
2
votes
1answer
153 views

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

I have a polyline feature with many segments (polyline split 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
130 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
80 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
43 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 "build_type"...
5
votes
2answers
106 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
30 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
161 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
350 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
96 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
91 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
48 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
18 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 = toint($...
2
votes
1answer
70 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
145 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
53 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
77 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
144 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
230 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
217 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
61 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
40 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
65 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
44 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
84 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
124 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
82 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
72 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" +[NAME]...
3
votes
2answers
216 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
89 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 ...
3
votes
2answers
72 views

How to give polygons a classificaton code in ArcGIS?

Does anyone have a trick for assigning polygons a code based on the classification classes? For example, if I symbolize the population of census blocks with 10 classes using Natural Breaks, I would ...
0
votes
1answer
217 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
366 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
71 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
54 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
39 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
131 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 ...
1
vote
1answer
41 views

Iterating through list of fields using field calculator?

import arcpy, sys, itertools arcpy.env.workspace = r'path to geodatabase' fields1 = ['gearqty', 'cnemarea', 'fzone', 'qdsq', 'tensmsq', 'crew', 'nanglers', 'port', 'totalquant', 'trip_days', '...
1
vote
0answers
73 views

Converting Atn function of VB Script for Python parser of ArcGIS Field Calculator? [closed]

I would like to convert the Atn function (which returns the arctangent of a number) of VB Script to Python but I cannot find exactly the same function. Any help? I want to convert the slope of ...
0
votes
2answers
92 views

Calculating percentages in ArcGIS field calculator gives TypeError: 'float' object is not iterable?

I am trying to calculate the percent AREA in each class. I have created a new percentage field and have tried to populate it using the following equation in python in the calculate field tool. ...
3
votes
2answers
71 views

Why is VBS If Then Label Expression not working?

I am trying to label a field based on other field. For [TYPE] = "PRIMARY", the [LABEL] is having this structure: "TAN80901B" For [TYPE] = "SECONDARY", the [LABEL] is like this: "TAN80901C/D20b" I ...
1
vote
1answer
43 views

Calculating average values of condition or receive values from a table for calculation in another table

I have a table with data (in this example the field "TSS"), a field time corresponds to the data for each point. I want to create a field with the mean values for each point all time values, without ...
1
vote
2answers
94 views

Calculate field more wisely

I first classified firstCol into groups and then I want to give the groups with different weighted values in another field, SecondCol. I will need to give different weighted values very often. I find ...
2
votes
3answers
162 views

If else if in ArcMap Field Calculator (Python)

Help! I think I am missing something that must be so obvious but I cannot figure out what I am doing wrong. Here's some background: I have one short integer field (MajAspNum) that has values 1-10....
2
votes
4answers
105 views

Calculate Length Totals in ArcGIS based on field values

I am having trouble finding the right words to describe this problem but here goes: I have 3 values (120,270,380) in my field called operatingvolt for every segment of conductor. Each segment of ...