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
0answers
50 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 ...
2
votes
1answer
75 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 ...
2
votes
1answer
48 views

Using Arcmap to update a field based on data from another fields

I'm trying to update latitude and longitude data per individual station for a lab I'm working for. Here's some code I have that's supposed to assign any all bay stations of a certain name the ...
2
votes
2answers
90 views

type mismatch: 'esri_8' when using field calculator

I am trying to run the VBScript 'round' function using the field calculator on a column for a numeric field that contains a large number of rows (> 500k). When I run the code on a subset of the field ...
2
votes
0answers
83 views

Creating a weighted rating model/script for vector data

I'm using ArcMap and trying to create a model or script that can rate routes based on a weighted calculation of attributes. Right now the individual attributes don't have rating values which I could ...
2
votes
0answers
57 views

Passing Value for Dictionary Look Up in Field Calculator fails [closed]

I've a field calculator that I am trying to use that uses a csv file to look up appropriate value based on key that is passed provided to the function. As provided below, the only values calculated ...
2
votes
0answers
124 views

How to add column to attribute table using field calculator with $length function?

I used the following code to add a separate column to the attribute table with the length of features. from PyQt4.QtCore import QVariant from qgis.core import QgsField, QgsExpression, QgsFeature vl....
2
votes
1answer
200 views

How to calculate square footage from multiple records into one field?

I want to add up the square footage for each building floor and enter the total into another field within the same feature class. Each floor has a different size and is a separate polygon with a ...
2
votes
0answers
605 views

Cause of Field Calculator UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 5: ordinal not in range(128)? [closed]

def Befahrung(value1,value2): if value1 is ' ': return ' ' else: return "G:\\Example\\" + str(value1) + "\\File_" + str(value2) + ".pdf" I try to create a field with a hyperlink. It works ...
2
votes
0answers
33 views

How to get Subtype name in Field using field calculator [duplicate]

I would like to get feature subtype name in another field using field calculator. Any one can advise to make this success? I am expecting ".Cal" file code using with Field calculator.
2
votes
2answers
352 views

How to trim strings in Field Calculator?

I am currently working on a County plat book and am in the process of prepping the "Owner_Nm" field that will serve as my annotation layer. I am trying to whittle down the owner names, based on ...
2
votes
0answers
32 views

How to save complex expressions in QGIS Field Calculator? [duplicate]

I have been debugging some long case expressions in the field calculator and getting frustrated because I have to remember to copy the expression before I test it otherwise I end up having to reenter ...
2
votes
3answers
1k views

Using python elif syntax in Field Calculator to reclassify a range of values from a different field and populate a new field

I'm trying to use the Field Calculator with a python elif statement to reclassify values from a different field and populate a new field, and while I'm not getting an error message of any kind, I'm ...
2
votes
2answers
809 views

Can anyone tell me why my field calculator is returning this error?

All I am trying to do is pull into a text field, a section of another text field via: fieldB = !fieldA![some_index:other_index] However I keep receiving the error below and I can't figure out why. ...
1
vote
2answers
350 views

Calculate field

I am working in ArcMap 10.2 and would like to calculate a field. The output should be the value of 'field 1' only if 'field 1' has a value 0 or it should give the value of 'field 2'. How to do ...
1
vote
4answers
6k views

Field Calculator: Add “0” to the front of all values in a column

I have a table for each state with Zip Code values. The 5-digit Zip Codes that start with "0" have been reduced to 4-digits. I cannot figure out how to add a "0" to the front of all the values in the ...
1
vote
3answers
148 views

Lists in field calculator in ArcMap?

Would anyone please indicate to me why this is not working. I am trying to convert all instances of '02ND' to '2ND' for example where some of the input fields (f1) are already converted and some are ...
1
vote
2answers
108 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 ...
1
vote
4answers
5k views

Calculating acreage using ArcGIS Field Calculator?

What is the expression to calculate an acreage in USA ? I am aware that there is a geometry calculate but when you convert raster to polygon it doesn't do it's job and I have to use the field ...
1
vote
4answers
884 views

Python script for Field Calculator. ArcGis 10.2.2

I have a point shapefile with two columns i want to process. The first column is aspect and the second is aspect_m60, there is only one row with the aspect of my point. I have tried to write a script ...
1
vote
2answers
129 views

How can I do more flexible matching in conditional expressions than provided by LIKE?

With LIKE '%' works but I have had no luck with character ranges, i.e. [0-9] to match a digit. Oh for a regular expression ;)
1
vote
1answer
4k views

Delete first two letters from a string field

I'm looking for a field calculator python statement to delete only the first two letters of string entries. For Ex: !Name!.strip([0:2]) I know this syntax is incorrect. Thanks a lot
1
vote
2answers
58 views

How do I calculate a field to be equal to another?

How can I calculate the StreetNames field to be equal to the values in the TEMP field in the below feature class attribute table? I am working in a file geodatabase in ArcMap version 10.1.
1
vote
2answers
508 views

Syntax error from Python parser of ArcGIS field calculator if then?

Using ArcMap - I would like to calculate one field based on the value of another field. I want to Update the field 'Date_Class' based on the value in another field 'MIN_YEAR_B'. I was trying to do ...
1
vote
3answers
3k views

How to Convert a Number to Percentage in Field Calculator

Using ArcGIS 10.2 and Personal geodatabase,I have a field with values of Numbers like 0.461538 and Type of "Double" can you please let me know how I can Export them to new Field in Percentage Format ...
1
vote
1answer
5k views

How to search text string and select item in QGIS?

I have a table attribute with complete roads name. I have to search items by digiting a part of the road name and I need to colour all the items selected. eg: ROAD NAME: / road 01 / road 02 / road 11 ...
1
vote
3answers
1k views

field calculator syntax error

I'm trying to calculate the direction the 'generate near table' function gives me into actual directions, N, NW etc. Azimuth would be a start too. I tried this script in the field calculator but it ...
1
vote
2answers
844 views

If/else statement in arcgis

I try to fill the fields with the condition if / else but it does not work. I do not know where is my mistake in the code. def TextValue ( !Classe! ): if !Classe! == "Steppe arbustive" or !Classe! ...
1
vote
2answers
67 views

How to add “0” to multiple parts of text value in Field Calculator with Python

I have values in a text column that are as follows: 000_100 100_200 ... 1000_1100 1100_1200 I want it to read: 0000_0100 0100_0200 ... 1000_1100 1100_1200 I want all values to have the ...
1
vote
2answers
723 views

Calculate Fields with Null Values using arcpy.da.UpdateCursor of ArcGIS for Desktop?

How do you calculate fields with null values? I have multiple fields that may have null values, that aren't being calculated in the third field. import arcpy with arcpy.da.UpdateCursor(r"...gdb\...
1
vote
1answer
10k views

Find and replace, field calculator

Can someone show me a very simple find and replace in field calculator for just one or two characters in a field based hyperlink?
1
vote
1answer
4k views

Concatenating fields using VBscript in ArcGIS Field Calculator?

I'm trying to get one column of text to move into another column that already has text. I DON'T want to replace it, I want the transferring text to be added to the already existing text in a shp file ...
1
vote
1answer
86 views

How to Edit Field using VBscript or Python in Attribute Table

I add a field called Name in attribute table in arcgis 10.1 but I can't edit this field. From this site, I have learned that this can be done by field calculator using VBscript or Python. As I have ...
1
vote
1answer
51 views

Capitalizing The First Letter Of Each Word In Attribute Field QGIS

I have tried capitalizing the first letter of each string in my field/column called "COMMUNITY" by referencing this post: Capitalizing The First Letter Of Each Word In Attribute Field Particularly: ...
1
vote
2answers
144 views

Split a string between 2 characters

I have the following string in Arcmap: "Node 1_1234.23,Node 2_567.88,Node 3_45.25" I want to return the numbers between the "_" and the "," into three columns e.g "1234.23" in column A "567....
1
vote
3answers
89 views

Generate a string based on an integer range

After some initial research, I was unable to find a solution for the following issue. I'm sure there's an answer to this question already floating around here somewhere, but hopefully someone can give ...
1
vote
4answers
453 views

How to remove period, comma, symbols using field calculator?

I want to delete . , # in attribute table using field calculator (VB Script or Python). How can I remove these using this example address: N. First St., Unit #1 (I don't need city or state name) I ...
1
vote
2answers
384 views

Calculate field management not working within customized Python tool in ArcGIS

I am trying to make a custom made Python Script tool which I would like to use in Model builder. I am using the arcpy.Calulate_field_management function (simple reclass function as an example), but it ...
1
vote
3answers
1k views

Extract numbers from string field

I am trying to calculate field test2 with only the numeric values from a string field test. The entire script is like: def makestr(test) list=[] for s in test: if s.isdigit(): ...
1
vote
1answer
133 views

Extracting data from Address field using ArcGIS for Desktop?

I am fairly new to using python in field calculator and could use some help. I want to populate SitusRdType with RD or AVE or LN or ST or DR depending on the road type. I also want to just have the ...
1
vote
2answers
150 views

Using Python For a Field Calc

In AcrMap 10.2 I'm trying to add a field and run this script in Field Calc: !shape.isMultipart! to see if I have any multipart lines. I keep getting geoprocessing failures. I am clicking the "...
1
vote
3answers
294 views

Conditional Statement for attribute data

I'm trying to write a conditional statement that references another field within the same shapefile layer. I want it to only do so if the one field is " Null " and leave is alone if there is already a ...
1
vote
2answers
472 views

How to get a string from a Double with a fixed number of decimals?

I have a featureclass (in a File Geodatabase), with a particular field of type Double. I want to copy it over to a text field, so that only 3 decimal places are shown. For example: 34.78902345 ...
1
vote
2answers
2k views

Debugging ERROR 000539 from CalculateField in ArcPy?

I previously successfully used the sample code here: How to calculate Field using part of filename in ModelBuilder? # Import standard library modules import arcpy, os, sys from arcpy import env # ...
1
vote
2answers
254 views

How to select only areas bigger than x acres?

I would like to create a new shapefile from another area shapefile. The new shapefile should only contain all areas that are bigger than 5 acres (10.000 m²). How do I do this?
1
vote
3answers
621 views

Replacing Variable in VB-Expression-File (.cal) of ArcGIS Desktop?

I'm trying to modify a VB-Expression saved in a cal-file by ArcGIS Desktop 9.3: dim out if [D19830701]=-9999 then out= [D19830501] else out= [D19830701] end if ...
1
vote
2answers
93 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 ...
1
vote
2answers
70 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: distance(...
1
vote
1answer
277 views

How to convert text to proper case using the field calculator?

I am working on a set of data that has over 40,000 records on ArcGIS and I want to use a Proper Case for several fields/columns on the table. Is there a Python or Java Script that can help me automate ...
1
vote
2answers
1k views

Using Python to field calculate Lat/Long with decimal degrees rather than meters

The below is a snippet of a python script that I am writing that basically adds two fields - Latitude and Longitude, then calculates them. I could use the Add XY Tool which gets me to the same point. ...