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)

5
votes
2answers
93 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
27 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
56 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
302 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
83 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
64 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
45 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
66 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
48 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
67 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
96 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
224 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
140 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
37 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
41 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
36 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
41 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
59 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
101 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
80 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
61 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
137 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
79 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
133 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
339 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 ...
2
votes
2answers
61 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
41 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
36 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
98 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
39 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
53 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
63 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
62 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
31 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
91 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
129 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 ...
0
votes
0answers
27 views

Calculate field for each Feature Class in Dataset using Python and different arguments

I have Dataset with Feature Classes in it. I'm building this in ModelBuilder. I want to calculate new field (SMB_ID) depending on attributes for each feature class. I was trying to make it simple ...
2
votes
4answers
89 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 ...
3
votes
1answer
41 views

QGIS - Field Calculator: scale_linear gives unexpected result

When I try to use scale_linear, its output isn't as I expected. My values are from 1 to 16, so I set domain_min = 1 and domain_max = 16. I want to interpolate to interval from 1 to 4 so I set ...
2
votes
1answer
63 views

Rename cells in Attribute Table to 'XXX.$ID'

I feel like this should be easy to answer, but I can't get it to work for me. I need to edit the attribute table of a .gpx file before I load it into my GPS, in order to label the points. I can rename ...
3
votes
3answers
79 views

Can't replace attribute with field calculator

I have an attribute table where one of the columns (laeskaerm) has been edited/created by checkboxes on 2 different machines. Result: it contains both 1, 0, true, false and NULL I'd like to replace ...
1
vote
2answers
55 views

How to compute the distance from the current polygon centroid to another in QGIS field calculator?

There is layer with polygons. I want to save in new field distance of every polygon's centroid to centroid of one particular polygon. To do this I should write some expression like this: ...
1
vote
1answer
52 views

How to edit virtual field definitions in QGIS?

I have a virtual field in QGIS. The values are updates depending another column with a concatenate CASE statements. I would like to edit this statement but I cannot see it. I have attempted to use ...
2
votes
1answer
78 views

QGIS processing toolbox: fieldcalculator - update only selected features is not possible

I am working on a model where I need some calculations on only some selected features. In the normal fieldcalculator you can check 'only update ... selected features'. When using the fieldcalculator ...
2
votes
1answer
111 views

Using ArcMap Field Calculator to count number of identical values?

I have a file with an attribute table with data in 3 columns, and would like to use field calculator to populate a 4th column. The data is integer numbers between 0 and 56. I want the new column to ...
1
vote
1answer
42 views

Polygon Surface Area Calculator in different map projection(s)

I'm simply looking for an online tool or a utility to calculate the surface area of the same polygon (i.e shapefile) in different projection (projected and geographic projection system) systems. It ...