Field calculators (which are available in QGIS, ArcGIS-related products, etc.) can recalculate the values of a single field, on all, or selected records within a table based on a symbolic expression.

learn more… | top users | synonyms

1
vote
2answers
1k views

ArcGIS field calculator: VBScript get data from previous row

When using the field calculator, how do I get data from the previous row in VBScript? In Python I'd do something like this: for index, row in enumerate(rows,start=1): row[index-1] += 5 I'm ...
2
votes
2answers
674 views

FIeld calculator gives integer not a real as requested

Two fields "population" and "F06_popula" (both integers) were used in calculating a new field pct-diff. I asked that the new field be a decimal with a width of 10 and precision of 3. The result has ...
2
votes
1answer
401 views

Field Calculate Degree Minute Second in Different Format

I have a field that is in degree minutes seconds, populated from ET Geowizards COGO Inverse tool. It populates the values as 90-12-28.15 where 90 is the degree, 12 is the minutes and 28.15 is the ...
3
votes
2answers
357 views

Python find string with two decimal characters

I have two columns in a personal geodatabase table that I'm trying to add up (to a third field) using a python function in field calculator, however some of the string values are not real numbers. ...
1
vote
1answer
89 views

How to import text only out of a string field to a new field

I want to import data out of a string field in my shapefile to a new field for labeling. The string field contains river names and codes and I just want to display the text i.e river names
2
votes
1answer
227 views

How to implent a “maketrans” python function on field calculator

i'm traying to implent python string translate function at field calculatore http://www.tutorialspoint.com/python/string_translate.htm in order to fix hebrew imported from cad. here is the code - def ...
2
votes
1answer
392 views

Field Calculator Runs In IDLE (2.6.5) but not ArcGIS 10 SP3

just wondering if anyone else is having issues with the field calculator in ArcGIS 10 SP3. In the following code I do a pretty simple field calculation with a variable (an array) as one of the ...
2
votes
1answer
403 views

Field Calculator operation is not working

I've done this 100s of times and I can't understand why it won't work! I'm trying to copy the first 8 digits of from a HUC 12 (Hydrologic Unit Code) to a new field, which represents a larger ...
4
votes
2answers
964 views

Field calculation- Arcpy

I am developing a script to calculate the values of two fields (C and D) based on value of field A (It is a Point feature): A C D 0.2 1 1 0.2 1 2 0.2 1 3 0.4 2 1 0.5 3 1 0.5 3 2 So the idea is n ...
0
votes
2answers
1k views

Update NULL values MDB table

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

Automatically assign numbers to point file in various order in QGIS

I know how to automatically assign numbers to a new point files using the $rownum function in the field calculator. However it does it from the top-left over and down like reading a book. I could ...
15
votes
6answers
4k views

ArcMap 10.0 Python Field Calculator, Find/Replace Double Quotes

I'm trying to use the Field Calculator (ArcMap (10)) to strip out double quotes in an address field (I didn't put them in there, believe me). I've tried many incantations but am still unable to even ...
1
vote
1answer
797 views

Concatenate Fields into One Field in QGIS

I have seen some posts on this, but only for ArcMap. I am looking to take a range of values from two fields and concatenate them into one field to make a unique value. For example: XMAX YMAX ...
5
votes
1answer
905 views

How to fill my column with consecutive numbers

I m very new to Qgis, so forgive this simple question. Searching in older topics didn t help either.So: I make a new column in my attribute table and it has a default value(for example 0). I want to ...
4
votes
1answer
373 views

How to add attribute data up?

Sorry if this question is too simple/easy for you guys, but I'm still learning QGIS and pretty much teaching myself where I can. Is there a way to add data from 2 columns into one new column inside ...
10
votes
2answers
815 views

How to compute a new attribute based on changes in another attribute?

I am attempting to classify a set of gps time-encoded point data into behaviors based on different attributes. I have created an attribute that is 0 for home and 1 for away based on location, and now ...
5
votes
2answers
885 views

How to find wildcard string using Field Calculator script code?

I'm trying to find part of a text string in the CLASS_NAME field and return a text string to the Abrv_Name field using the Field Calculator in ArcGIS 10 via a Python parser. Here is what I have tried ...
1
vote
2answers
362 views

FieldPyculator Plugin - How to Classify Fields?

Could someone tell me how to classify/populate fields with QGIS FieldPyculator Plugin? In the Attribute Table, I have a field named POPULACAO with population data: I want to apply a weight to ...
2
votes
3answers
691 views

Python and CalculateField

I am having trouble with using Python together with my gp.Calculatefield tool in my python script, and I am not sure why.. Heres the code (UPDATED) import arcgisscripting, os, sys myTempWorkspace = ...
2
votes
2answers
2k views

Multiple input tables for Add Field in ModelBuilder

My model requires field1 to be added to fc1 and fc2, and then calculated according to a Python expression calc1. field2 is then added to fc2, and calculated using calc1. How do I add the multiple ...
3
votes
2answers
671 views

Why is ICalculator.Calculate significantly slower than the CalculateField geoprocessing tool with SDE datasets?

I just discovered today that there are essentially two ways to calculate field values in ArcObjects: 1. Using ESRI.ArcGIS.GeodatabaseUI.ICalculator: ITable table = …; ICursor updateCursor = ...
3
votes
2answers
1k views

Use output of Add Field as input for Calculate Field in ModelBuilder

I have created a simple model in ArcGIS 10 which, after some initial processing of a feature class, outputs outputfc and adds a field to it. Regardless of the feature class input (which the user ...
2
votes
2answers
421 views

Looking for python/VB script to insert a new uniqe field

Is there any phyton/VB script which will add a field to shapefile which will be corresponding to first three characters from the shapefile name ? I am working in modelbuilder and arcgis 10. Thanks ...
3
votes
2answers
534 views

Adding VBA into a Python script generated by ModelBuilder

I have created a model that does a calculate field and have used VBA in the code block. But when I export it to Python, it doesn't work. Here is the VBA code: new_value = ...
6
votes
2answers
501 views

Random value calculation in QGIS

Is there a way to do a random value calculation within a range in QGIS? I have been able to do this within ArcMap Field Calculator with the following code: Dim max, min max=20 min=5 ...
0
votes
1answer
335 views

Python Field Calculation [duplicate]

Possible Duplicate: Iterative position within Field Calculator/Python I need to calculate a field for a data set that is grouped by county. At each change in county I need the column to ...
2
votes
1answer
186 views

Why isn't this Python calculation working correctly?

I want to label the source files for a unified shapefile, and there are three respective columns for each. If there is no value in the column, there is no data from that source; if there is a value in ...
1
vote
1answer
211 views

Small issue with field calculator

What am I doing wrong in this field calculator logic? Pre-logic def re_score(elev_t,f2, contour): f2=contour if elev_t.endswith('.5'): f2 = "Midi" return f2 Expression for field "Contourtyp" ...
2
votes
1answer
508 views

Iterative position within Field Calculator/Python

I'm not great with Python or programming in general, so I'm not even sure how to ask this question. Basically what I've got is in the left column, and what I want is in the right column. UniqueID ...
3
votes
3answers
2k views

split string after first word

I want to split a string field after the first word using the space as a delimiter so that "WA ROSSOUW ORANJE BELEGGINGS" becomes "ROSSOUW ORANJE BELEGGINGS". I am using Arcmap10. Thanks.
2
votes
4answers
3k views

Basic Field Calculator help

I have no experience with Field Calculator in ArcGIS 10. I have a very simple calculation I would like to perform that I could do easily via pure SQL but just can't seem to get my head around it in ...
1
vote
1answer
1k views

Do QGIS Field Calculator xat(n) and yat(n) functions work in version 1.7.x?

I'm trying to use the xat(n) and yat(n) in the Field Calculator but can't get them to work. Does anybody have an example how to use them? I need the start and end coordinates for line segments, does ...
3
votes
2answers
4k views

Using conditional statements in Field Calculator

I have two fields, "P_Area" and "PC_Area", whose sizes I'd like to compare in a third field, "Areas_Equal". The "Areas_Equal" field should contain a "Yes" if the other two are equal and a "No" if they ...
4
votes
3answers
3k views

ArcGIS 10 Python split string

I am trying to use Python to split a string field into three new fields at the separator " - ". The field is in the format "a - b - c". So I initially had this in the field calculator for newFieldA: ...
0
votes
1answer
571 views

Null output from field calculator code block

I have a simple calculation to compare two columns and populate a new column with the lower value but I am getting null output...any ideas? expression ...
3
votes
3answers
6k views

Simple field calculator equation in ArcGIS 10 not working

I'm new to ArcGIS 10 and am trying to do a really simple field calculator equation and it is not working. I'm just trying to find the percentage of a certain demographic trait by doing: ...
4
votes
2answers
542 views

Why does field calculator expression sometimes return a binary value (0 or 1)?

I am running simple field calculator expressions and experiencing some of the silliest results I have ever seen. I am working on census data (living as a shape file) and trying to perform a simple ...
4
votes
2answers
852 views

arcpy: check for same record in cell above and below

After using the find duplicates in arcmap 10, I want to check if the feat sequence ("find duplicates" marks all records with the same attributes with the same number [in "feat_seq"] and creates a ...
7
votes
4answers
2k views

How to remove numeric characters from alphanumeric value in field calculation?

I have a field containing alphanumeric values in the following format: A-AA00 Sometimes they are also A-AAA0 I need a Python script I can put in the field calculator in ArcMap 10 that will at ...
8
votes
3answers
2k views

How to round a column in attribute table (ArcMap)

I want to use the Field Calculator in ArcMap to round an existing column to two decimals. Currently I have a column that is 6 decimal places long and would like to simply round it down to 2 decimals. ...
2
votes
1answer
876 views

Summing Attributes from a Related Table?

I have a line feature class representing road segments, with each road segment having a unique ID. This feature class has an attribute of average observed daily traffic counts. I have another table ...
6
votes
4answers
4k views

Field Calculation - Python - If/Then over multiple data columns

I have some VB code saved that looks at two columns of data, and populates a third with the low value. Pre-logic Script Code: Dim output as double if [MIN_LEFT] < [MIN_RIGHT] Then output = ...
2
votes
1answer
537 views

Does QGIS support parsing of date strings in tables?

It is straightforward to load GPX files (GPS downloaded tracks / points) into QGIS, then save and manipulate them as shapefiles. However, the recording date (in the comment (cmt) field) of waypoints ...
6
votes
1answer
1k views

Get shape filename in attribute field using field calculator

I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
4
votes
3answers
411 views

Moving “last name” from last to first in the Attribute Table

How do you get e.g. "John D. Doe" to "Doe, John D." in the AT using VB Scripting without going individually going through each line? I am using ArcGIS 9.3. I should note that not all the names are ...
6
votes
2answers
3k views

Converting from DMS to DD using Python in Field Calculator

I need to convert lat/long that is expressed as degrees, minutes, and seconds in the data into decimal degrees. For example, in the data, they are listed as N335042.06 in the Latitude column, and ...
2
votes
1answer
2k views

How to count and record the number of entities with the same name in the field calculator?

I have a question with ArcGIS 9.2. In an attribute table the column [name] includes the name of every place in this layer. Next to that (in columns [numbers]) there should be recorded how often a ...
1
vote
3answers
998 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 ...
4
votes
1answer
1k views

How to convert state name abbreviations to full names?

I have a data table with columns that includes city names (ex: San Jose) and state name abbreviations (ex: CA). Is there a way to define the state names as their full names (i.e., CA = California) and ...
3
votes
2answers
4k views

Nested “if” statements in ArcGIS Field Calculator

The solution in VB for the base process is @ "If then" VB Script code (or Python) equivalent to SQL's IN ('x','y',z') expression in ArcGIS Field Calculator question? ...