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

4
votes
1answer
414 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 ...
4
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.
4
votes
3answers
442 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 ...
4
votes
5answers
981 views

Is there a Log or Ln function in QGIS Field Calculator?

I can't seem to find any way to take the logarithm (natural or base 10) of a field in QGIS. I have gotten to the field calculator but there is not a button for log and I can't seem find any formula ...
4
votes
2answers
173 views

ArcMap: Calculate Quarter using Date field

I am using ArcMap 10.0 and making a map where I symbolize on annual quarter (i.e. Q1 2013, Q2 2013, and so on by quarter through 2015). If a date field contains this: 01/15/2013, and I wanted to ...
4
votes
2answers
994 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 ...
4
votes
2answers
151 views

Can Hyperlink be based on two fields for path and file name separately?

I need to create a hyperlink field. I have one field with the file name, and another field that contains only part of the file path (the real path is unknown). The table contains 14,000 records with ...
4
votes
3answers
688 views

How to insert a quotation mark through the Field Calculator of attribute table of a Shapefile?

I have a shapefile of polylines with information of diameter. But the problem is that i didn't enter the inch sign(") with the values of diameter. What would be the solution that qutation mark would ...
4
votes
1answer
3k views

How to do a simple find and replace in QGIS field calculator?

I'm trying to replace selected string values in an attribute table, eg. "Text1" for "Text2" (QGIS 1.8.0), patriculary for those rows with NULL values. I have been trying to use the replace expression ...
4
votes
1answer
642 views

Why can't I multiply two string fields in the Field Calculator by converting them to int() and float()

I'm using ArcGIS 10 and new at python scripting. I have a string field that I need to calculate by multiplying two other string fields. I can do it in python using two arbitrary values... CINPT1 = ...
4
votes
2answers
2k views

VBA functions use in ArcGIS Field Calculator

Would this be ok to use them for the field calculator in ArcGIS 9.3 ? See here MS Excel VBA Functions Or should I fix them in MS Excel and save as a file and then use the join with the shapefile or ...
4
votes
1answer
54 views

Calculate Field in ModelBuilder gives General error executing calculator. ERROR 999999: Error executing function. Expected end of statement?

I am attempting to do zonal statistics for multiple images and I need to add an extra field that will have the name of each raster file in each row to the finally appended file. I have added a field ...
4
votes
1answer
128 views

How to use Field Calculator to assign values to only Odd (or Even) page fields for Data Driven Pages?

I am creating a map book but do not want the page numbers for each map page to be on the same side (since its printed double sided), I need the page numbers to be placed on opposite sides? I am using ...
4
votes
2answers
78 views

How to replicate trunc function on QGIS?

I've search a bit before asking this question, but I haven't found the answer. Is there a Trunc function on QGis? I've tried using floor, but it doesn't work (like I want) if the number is negative, ...
4
votes
4answers
2k views

How to concatenate numbers and add in leading zeros?

I have three text fields populated as follows: 1, 9, 1 that I need to concatenate into a field that looks like 01.09.01. Getting to 1.9.1 is easy but can anyone help out with how to formulate it so ...
4
votes
1answer
633 views

Unit of $length in QGis Field Calculator

I'm calculating field of various features in my shapefile using QGis. I'm getting some sample length as 0.134914579766986. I want to know in what unit (eg: meters, km etc) is the above value ?
4
votes
2answers
600 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
975 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 ...
4
votes
1answer
85 views

Are Date columns in feature classes stored as python datetime objects?

I have a Date column called readings_measurement_tstamp stored in my feature class. I would like to add a String column to this feature class and Field Calculate it to be be just the %H:%M:%S ...
4
votes
1answer
403 views

How to use the Intersects function in the Field Calculator of QGIS?

I would like to have an example on how to use the Intersects function in the Field Calculator of QGIS. Basically, I want to know which feature from a polylines layer intersects a polygons layer and ...
4
votes
1answer
994 views

Qualifying field names in field calculator

I am trying to set up a quick model that: Takes a point feature layer of development projets (a table in an access database with xy coordinates), Spatially joins polygon neighborhood designations to ...
4
votes
2answers
106 views

Calculating the average / MEAN of an attribute field in a QGIS model

I need to know how to calculate the average / mean of an attribute field in my point shape file. Is this possible to do with the field calculator? I just found the options min or max but not mean. The ...
4
votes
1answer
537 views

Syntax of conditional statements in QGIS Field Calculator(s)

I have a shapefile which I need to modify. There is one column "CLASS" with the attributes: "A", "B" and "C". I need to change "A" into "1!, "B" into "2" and "C" into "3". I tried it with case when ...
4
votes
1answer
83 views

Area calculation of an object without coordinates

I have a photo of an object with a scale and I want to calculate its area. I guess I have to create a polygon of the area to be calculated to use the 'field calculator'. But how do I tell the program ...
4
votes
1answer
132 views

How to use %value% (from For iterator) in SQL expression of Calculate Field in ModelBuilder?

I have a shapefile with data of fish specimens and the coordinates where they were tagged for research purposes. One of the fields in the attribute table of these shapefiles is the fish length in ...
4
votes
2answers
441 views

Field Calculator decimal places - how can I limit them?

I've added a new column to an attribute table and performed an operation with the field calculator to populate the new column. The result is a column with a percentage. My problem isn't major but I ...
4
votes
1answer
112 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 ...
4
votes
3answers
149 views

Is there a way to close a geoprocessing operation when the dialog box has been hidden/pushed to the back of the window

Is there a way to close a geoprocessing operation when the dialog box has been hidden/pushed to the back of the windows? I ran a python process as VB Script and when the error message appeared I ...
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: ...
3
votes
3answers
761 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
141 views

ArcGIS 10.1 : Returning shape.area in my code block

I try to calculate a field using an 'if' statement in the field calculator. Here is my code : " #Expression MyField_2 = def Reclass(!MyField_1!) #Parser Python 9.3 #Code Block def ...
3
votes
3answers
2k 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 ...
3
votes
1answer
1k views

What expressions for QGIS field-calculator?

I do not understand what language I have to use in field-calculator and labels on QGIS: SQL or Python? And where I can find the possible script/expressions to use? in the image you can see the ...
3
votes
3answers
167 views

Count the number of characters in a field (Python)

I have a field that contains street names and a second field called COUNT. I need to perform a Python field calculation on the COUNT field that counts the number of characters in the STREET_NAME ...
3
votes
2answers
89 views

Calculate Field Syntax: If statement over many fields

Apologies if this has already being asked but I couldn't find a page pointing to this problem. I'm struggling with the python syntax in the Calculate Field so that, in the table above: if b, c, d, ...
3
votes
2answers
2k 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 ...
3
votes
1answer
187 views

Can't compute area of shapefile in field calculator

This shapefile represents the counties of NM. I am trying to compute the area of each polygon (yes, I know there is an area field, but this is a simpler example of a problem I'm having which doesn't ...
3
votes
1answer
2k views

Using Python to Calculate a field

I am trying to replace values in a single column using an else if statement, but I keep getting an Syntax error in line 2. I'm new to Python so it's probably an easy solution, but I haven't been able ...
3
votes
2answers
5k 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 ...
3
votes
2answers
968 views

Force the decimals to use the comma in Field Calcuator ArcGIS 9.3.1

Can I add the comma "," to force the decimals to remove from the attribue and replace with the number? For example, I have an Acres field column that says 506320.0750 and I want to replace the decimal ...
3
votes
1answer
289 views

Adding an “m” to the end of every number in a row

What function do i need to use to add an space and an m after every item in a row, using the field calculator in the attributes table. I have a load of numbers (as strings) and would like to add m ...
3
votes
3answers
3k views

Basic If/Then in ArcGIS 10.2 Field Calculator (Python or VB)

I've been looking through these threads and can't seem to figure out my answer yet. Very new to VBA and Python, but lots of years with Arc.I know I can do this the slow way with Select By Attributes, ...
3
votes
3answers
766 views

Auto-calculate field (area or formula)

I'm wondering if anyone has any insight into the potential to auto-calculate the value of a field, either area or distance (ideally) or a formula (based on the values of say 2 other fields, or an ...
3
votes
1answer
3k views

Elseif Conditional Statement in QGIS Field Calculator

I am trying to write an ELSEIF conditional statement in QGIS Field Calculator (version 1.8.0). I have used an example I found online: CASE WHEN val < 0 THEN 'negative' WHEN val = 0 THEN ...
3
votes
2answers
413 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. ...
3
votes
2answers
767 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
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 ...
3
votes
1answer
143 views

Using Python in Field Calculator to compare two fields

I'm trying to use field calculator to compare two fields in a table of tax parcel data, Land Value (LAND_VAL) and Improvement Value (IMPRVT_VAL). My goal is to determine (1) Parcels with land value ...
3
votes
2answers
70 views

How To Determine Percent of Matched Data?

In my attribute table, I have 2 columns with qualitative (categorical) data. Both of them are from different sources so I am trying to find the percent of matched data from these 2 columns. I created ...
3
votes
1answer
94 views

How to find lowest value that is not null using Python in ArcGIS for Desktop?

I have four fields in my table, (A,B,C,D). The field type is double with some fields being NULL. I used min(A,B,C,D) to return the smallest value and it works well if there are no NULL value in any of ...