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
1answer
26 views

How can I copy non-blank values to a new column from different columns in the same layer in QGIS?

My data: n1 n2 n3 NEW_COLUMN 11 null null null 33 null null null 55 My desired result: n1 n2 n3 NEW_COLUMN 11 null null 11 null 33 null 33 null null 55 ...
0
votes
1answer
31 views

find all the null records for all fields in a shape file

I figured out that I can use field calculator on a single column in arcgis 10.3 attribute window as follows: def RemoveNULL(x): if x is None: return '' elif x == '': return ...
1
vote
3answers
3k views

Replacing NULL values in geodatabase table?

How do you update NULL values within a geodatabase table using the ArcGIS Field Calculator (service pack 4) without changing other values to NULL? I've tried the suggestions on this previous ...
1
vote
1answer
46 views

If/then python for classifying existing field values to a new field

I'd like to have a tool or quick python script to classify an existing number field to a new text field. For example I have a roads layer that has a type identifier as a coded number and I would like ...
0
votes
0answers
15 views

How to create new field using the values of one attribute column multiplied by a constant number in Qgis or ArcGIS [duplicate]

I have point data that has a small length attribute - I want to times this length attribute by a constant number (I need to trial a few different constants) to find the diameter of a protection zone ...
1
vote
1answer
28 views

How do I Calculate Grouped Percentiles or Batch percentiles in ArcMap?

My question is similar to this one which was answered successfully: Calculating Percentiles in ArcMap? My addition is how do I batch this solution for multiple files or apply a group-by feature to ...
0
votes
2answers
56 views

Remove first seven characters from field string using Field Calculator

I wrote an expression/codeblock that removes the words "Nearby:" from the field value string if it has it. Codeblock: import string def splitme(s): if s[:7] == "Nearby:": aList = ...
6
votes
1answer
191 views

How to refer to another layer in the field calculator?

Is there a way to select an attribute from a polygon layer and insert the value into a virtual field of a point layer using "within" in the field calculator? CASE WHEN within($geometry, ...
0
votes
2answers
47 views
1
vote
1answer
27 views

VB Script case statment syntax for the field calculator in ArcGIS 10.2?

Can anybody help me with this VB Script code for the field calculator in ArcGIS 10.2? Why in the final result are all the values 10? a= 10 Select Case UCase( [PRIORITY] ) Case "AUX 1": a = 22.5 ...
6
votes
1answer
195 views

Calculating a Unique ID on a Subgroup of Polygons

I would like to assign a unique ID to polygons in a dataset. The catch to my issue is that I would like polygons that fall within a polygon to have the same unique ID. My example is related to ...
2
votes
1answer
23 views

Alphabetical Sort within a Record

I am performing a union on a polygon feature class with multiple overlapping polygons. Each of the records in the resulting feature class can be thought of as "unique area" polygons made up of the ...
2
votes
3answers
113 views

Using .len() in IF THEN statement in ArcMap field calculator

I have a string field with values of varying lengths (1-4). I need each value to have a length of 5 characters by adding zeros to the value until the length equals 5. For example: 123 needs to ...
3
votes
1answer
45 views

add text value to attributes

this is a novice question I have an attribute field that's missing a piece of information, i'd like to amend the attribute field like below: This is the current attribute field: "V:\Building & ...
1
vote
0answers
39 views

If then statement in model builder

I have a model that adds several fields, two which are manual inputs (County Name and User). I am manipulating several parcel layers (approx 90 counties). In my model, one field takes the state and ...
1
vote
0answers
25 views

Forcing area calculation into miles in QGIS (without changing the PCS) [duplicate]

I'm working on an assignment that requires me to create an area column in miles without changing the projected coordinate system. ArcGIS has a tool that can do this ('Calculate Geometry')-- does QGIS ...
-1
votes
1answer
30 views

Transferring Attributes on the Same Layer [closed]

How can I copy the values of one field in an attribute table into another field in the same attribute table?
4
votes
4answers
2k views

Calculating X and Y of line start and line end using ArcPy?

I have a series of polyline shapefiles and I am trying to automate the process of calculating the X and Y coordinates of the line start and line end using Python. I have added the 4 fields (startx, ...
3
votes
3answers
681 views

How to make Field Value constant size (length) by appending zeros towards end?

How do I append my field values in my .dbf to correspond with the values of my feature's attribute table. I need to append 0's to the field value if the field value is less than 11 characters in ...
1
vote
1answer
233 views

How to create sequential field based on sorted data? (or extract pop-up data?)

I downloaded a kmz field and converted it to a GDB fc on arcmap. However, the field I need to label the layer by is stored in the pop-up html field... It looks like this: <html ...
0
votes
0answers
21 views

x and y coordinates will only display [x],[y] when field calculator is used to make a url

The standard formula for a google maps url is: https://www.google.com/maps/@-15.623037,18.388672,8z https://www.google.com/maps/@(latitude),(longitude),(zoom level)z I am trying to make a new ...
2
votes
3answers
96 views

VBScript - If/Then Statement - Field Calculator

I am trying to do a simple (or so I thought) if/then statement in the ArcGIS field calculator. I am trying to add the HydroCode field - hydologic soil codes - to an existing data set. I know what the ...
0
votes
0answers
6 views

Problems with rasterization through QGIS Modeler

My goal is to rasterize a vector polygon-based shapefile. Whenever I run in the modeler or even from the Processing Toolbox the Rasterize tool of GDAL, I receive a raster layer that's not good for ...
5
votes
2answers
1k views

How to replace arcpy.CalculateField_management with an update cursor?

I'd like to replace this expression arcpy.CalculateField_management(bufferFile, "Shape_Area", "float('!shape.area@squaremeters!')", "PYTHON") with an arcpy.da.updatecursor. The reason for this is ...
4
votes
3answers
6k views

How to replace null values in attribute table ArcGIS 10.2

I have a string field 'Oneway' with three values '+' '-' and Null showing a street accessibility, I would like to replace them with values 'F' 'T' and null as the script for Network dataset expect ...
1
vote
2answers
1k views

Using File Geodatabase with Null values in Field Calculator of ArcGIS Desktop 10.0?

I want to use the field calculator to get the sum of a couple of columns. The problem is that some of them has Null Values. I am not able to find a solution. I tried this Python functions: stack( ...
4
votes
1answer
4k views

Field Calculator VB Script Codeblock IF statement syntax is wrong?

I can't figure out why the syntax is wrong in Field Calculator ArcMap 10. The complete codeblock is Dim CapitalDia As Number Dim TwagDia As Number Dim X As Number CapitalDia = [New_Pipe_S] TwagDia ...
3
votes
1answer
43 views

Add comma to number labels, multiple records in attribute table

A QGIS question: How can I insert commas in 4 digit numbers in an attribute table that has multiple records, with some numbers that are only in the hundreds? It's for an animation so multiple labels ...
1
vote
1answer
32 views

How to delete char in table attribute in QGIS 2.6.1

I need to label many items but in the table attribute field there are some char (#F) for every item that I have to delete. The length of the description are not always the same. I create a new field ...
1
vote
1answer
369 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. ...
1
vote
1answer
32 views

extract substring after first number

Suppose I have a field titled NAME1. Examples of what is in the field appear like this: Fox Lake 1 WABASCA 166 TSU TUE 196G YELLOW QUILL I.R. 90-8 POUNDMAKER INDIAN RESERVE NO. 114-17 CROSS LAKE ...
1
vote
1answer
34 views

Using Advanced Python Calculator in QGIS Modeler

I'm trying to create a column with integer values based on a small function that basically uses conditional statements. In short, a reclassification. My attempt below: def getValue(Etat): if Etat ...
3
votes
5answers
291 views

Easy way to sum up a lot of values?

I've got a shapefile that was made by the mother of all Unions. Because of that, it's got about 400 columns, and I want to sum about 100 of them (specifically, the "Score" from each). Is there an ...
1
vote
1answer
46 views

Conditional Statements in Arc Map 10 (field Calculator)

I'm attempting to calculate the values of a field based on IF THEN statements in ArcMap 10 (in field calculator) but I haven't succeeded yet on that. What I want to add is the following expression: ...
4
votes
1answer
356 views

How to use QGIS field calculator in python?

I would like to use QGIS Field Calculator in Python to update the existing column based on certain conditions? How can I do this?
0
votes
2answers
57 views

Combine string and OBJECT ID

I would like to update the Map_Feature_ID field with a String " WP_" and then follow the "WP_" with the OBJECTID field. So I will end up with "WP_1", "WP_2" all the way to the end in the Map Feature ...
3
votes
1answer
179 views

How to calculate the intersected area from a layer with overlapping buffers in qgis

I need to calculate the area of landusetypes in 50m around various dots (all in one shapfile). My problem is, the buffers around the dots are overlapping each over in some places. I tried to ...
1
vote
1answer
53 views

CalculateField with variables

I'm trying to make a python script on arcmap 10.2.2 which will copy values from an old field (selected by the user) and paste them in an new field (named by the user). I wrote that: fc = ...
0
votes
1answer
52 views

Counting Features to Calculate Field Value

Generally, I am trying to find the # of features in one shapefile within 1000 feet of EACH feature in a second shapefile - and then populate a field in the first shapefile with that #. More ...
8
votes
5answers
3k views

Is there a way to concatenate fields in field calculator of QGIS?

Is there a way to concatenate fields in field calculator of QGIS? (e.g. hectares + ' ha')
0
votes
2answers
82 views

ArcGIS Python if statements say field not nullable?

I am creating a new field - let's call it A (SHORT INTEGER) in shp file using Modelbuilder and I need to fill it it with the values from two different fields. First step is to fill field A with the ...
2
votes
1answer
61 views

Calculating Sinuosity Using ArcGIS Field Calculator

Trying to calculate sinuosity via Field Calculator (ArcGIS v 10.2.2); VBA Pre-Logic Script Code: Dim dblLe as double Dim dblLf as double Dim dblS as double Dim pCurve as Icurve Dim pFPoint as IPoint ...
2
votes
3answers
54 views

Creating Conditional Statement in QGIS Field Calculator

I've looked up some of the other threads on this topic, however, none have addressed what I am seeking to do. Essentially I have a large data set and I would like to search one field for any values ...
-5
votes
1answer
40 views

Field calculator with next() function? [closed]

I want to do calculate with script, field - field.next () with incrementation of 2 rows
2
votes
2answers
3k views

Using Value from Iterate Feature Selection to Calculate Field in ArcMap 10.1 ModelBuilder

I have two polygon feature classes, an alignment layer and a parcels layer. I am trying to use ModelBuilder to create a tool that will do the follow: iterate through groups in a single field of a ...
1
vote
1answer
58 views

delete a space with the field caculator

I would like to delete the space in this number like this 'F00 089' with the field-calculator. Is theres a function in the field-calculator? ! see my screenshot
2
votes
1answer
60 views

Replace Expression in Field Calculator to include a Numeric Range

There has to be an easier way to clean up address data, I hope? GeoCoding, I need to remove APT# and any number or letter that follows.
1
vote
0answers
1k views

Using multiple fields for a Reclass calculation in ArcGIS Field Calculator [closed]

I am trying to create a dummy variable from an existing dataset using ArcGIS's Field Calculator tool with a Python script. My conditions require the use of multiple fields to determine the output ...
2
votes
1answer
181 views

ArcGIS Python syntax error using nested if else

I am trying to use the field calculator in ArcMap 10.2 to fill an empty field based on the contents of two exiting fields usint this python script in the Pre-Logic Script Code. def ...
4
votes
3answers
5k views

ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script

I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...