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)

3
votes
2answers
228 views

Problem using field calculator to add numbers in new field with preceding zeros

I wish to add a field in an attribute table that should work as a georeferencing key. It needs to take into consideration values from a series of fields. The last field is a housenumber and it ...
3
votes
2answers
3k views

Forcing decimal numbers to use comma in ArcGIS Field Calculator?

Can I add the comma "," to force the decimals to remove from the attribute and replace with the number? For example, I have an Acres field column that says 506320.0750 and I want to replace the ...
3
votes
3answers
1k 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 ...
3
votes
1answer
2k 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
767 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
167 views

Calculate sequential numbers into sorted table

Is there a way to calculate a sorted field with sequential numbers? I have seen a post that outlines how to calculate sequential numbers, but this is always calculated on FID order, not on sorted ...
3
votes
5answers
433 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 ...
3
votes
2answers
323 views

VB Script or Python for Field Calculator when using greater/less than?

What I have: I have 4 fields for my address ranges. L_ADD_FROM, R_ADD_FROM, L_ADD_TO & R_ADD_TO (all in DOUBLE field type). What I need: The lesser value from L_ADD_FROM and R_ADD_FROM to ...
3
votes
2answers
219 views

Using Field Calculator to append attribute

I have a field containing the file names for photos. I need to add the folder location to the beginning of each file name. Anyone know the code for doing this in Field Calculator?
3
votes
2answers
197 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
4k views

How to use the replace string function in Field Calculator?

Within an attribute table I'm trying to replace one string with another using the 'replace' function . As an example, there are a number of features whose field 'NAME' contain the string '(B)' and ...
3
votes
4answers
3k views

Why does Field Calculator return 0 values when decimals are expected?

I realize I posed this question, and got answers, several days ago (see (Field calculator error)) , but none seem to really be working, and so am posing again. Below are two screenshots that show the ...
3
votes
2answers
3k 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
5k views

Setting value of field in all selected rows of table using ArcGIS Desktop?

I have an attribute table in ArcGIS 10 (it's large - around 300,000 elements). I've selected some rows of the table using 'Select by attributes' and I want to set the value of a field for all of those ...
3
votes
1answer
186 views

“ ”.join(list) not inserting spaces when calculating field

I have a Python script where I'm trying to take the values from three fields (street address data - direction, street name, street type) and combine them into one field, e.g. S, Main, St should be S ...
3
votes
2answers
153 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 ...
3
votes
2answers
320 views

Extract string between special characters - and / into a new field ArcGIS Field Calculator

Can I create a field calc expression in ArcGIS 10.3 to print a selection between special characters? I would like to extract a selection of string from field [FolderPath] to a new field [Name]. The ...
3
votes
3answers
637 views

How do I normalize the values in a single Field (from a table) in ArcGIS?

First of all, this is my first post, and I would like to appreciate all the useful information I have found so far on this site. Second of all, I have encountered a problem, in Field Calculator. ...
3
votes
1answer
3k 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
610 views

Python find string with two decimal characters in ArcGIS field calculator?

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
8k 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
1answer
326 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
2answers
855 views

How to populate a text field with double quotes using field calculator

How would I populate a text field with double quotes using the Field Calculator. For example, I want to populate a field as 24". Is there a way to populate fields using the field calculator with ...
3
votes
1answer
927 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
4answers
2k views

Why do area calculations return negative values?

I have created a shapefile with some polygons and am now trying to calculate the area of these polygons. The original CRS was WGS84, I have reprojected it to WGS 84 / World Mercator so unit is metres. ...
3
votes
3answers
2k 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
2answers
10k views

Auto fill column in attribute table

Is there a way to fill a column in the attribute table with the same value, similar to a paste . Is there something in the calculator that can be used to fill selected records/attributes.
3
votes
4answers
2k views

Field Calculator in ArcGIS - keep equation

I'm using Arc 9.3.1 (Arc Editor). In edit mode I've created a simple field calculation. For example's sake let's make it [Field3] = [Field1] + [Field2] How do I 'keep' the calculation so Field3 ...
3
votes
1answer
88 views

Calculate Field using variable in arcpy

I've got a problem with my script and hope that someone can help me. What I´d like to do is using the field calculator to calculate values for a field using values from another field and a variable ...
3
votes
2answers
126 views

Calculate Field - getting the code value but not the description

If STREETNM value are blank or _ then I want to replace them with the value of ST_DESIG. My code below returned the code value of ST_DESIG but not the description. How can I get the description ...
3
votes
2answers
169 views

Calculate QUARTER from Date field using ArcGIS Field Calculator?

I currently have a Date field in the format of MM/DD/YYYY. My goal here is to convert the Dates into 1 of 4 quarters, along with the Year. The field to be created will be called QTR_YR. My first ...
3
votes
3answers
2k views

How to calculate a value based on another field under arcpy.da.UpdateCursor and cursor.updateRow?

I am trying to do a calculations under arcpy.da.UpdateCursor. I want to calculate the values for the records that have FIPS=06037. I want to take the values from "kg" column and populate the new value ...
3
votes
2answers
283 views

How to pad field with blank spaces using calculate field tool of ArcMap?

I am trying to pad the right side of a field with blank spaces so that when I label the field, it labels further over to the left. The only way that I can seem to make this work so far is by adding a ...
3
votes
1answer
738 views

Joined tables and now field calulator is greyed out

In ArcMap (10.2), I accidentally calculated the wrong field outside of an edit session, so there was no way to reverse my action. I restored a previous version (shadow copy) and joined the tables ...
3
votes
2answers
269 views

Assign field values (double) based on values of other field (string) using field calculator

I want to assign numbers to a field, WScore (double), based on field values of Soils (string). They are in the same table of a raster. I'm not trying to add text to a double. What I want to do is ...
3
votes
2answers
286 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
128 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 ...
3
votes
2answers
975 views

If-Then Statement in Field Calculator

Scenario: I have four fields: A, B, C and D Field A is text-based and contains values from '000' up to some number 'xxx' Field B contains a set of values (also text, but represented by numbers) ...
3
votes
1answer
4k views

Calculating incidence angle of polyline?

How can I calculate the angle of each polyline in ArcGIS?
3
votes
1answer
1k views

Calculate attributes to table based on other attributes

I am going through thousands and thousands of road lines and giving them a value based on QC with imagery. So for instance for the add_data field I give it one of these five numbers: 0 = not ...
3
votes
1answer
705 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
224 views

Updating new field from existing field using ArcGIS Desktop?

I need to update my new field/column (Property Type) with either "detached", "semi", or "terrace" depending on an existing column (Property Count): where the count = 1 I need to populate Property ...
3
votes
1answer
3k views

Selecting by attribute and calculating field of new selection in ModelBuilder?

I have a polygon shapefile (with 4000 records in it) that I want to group into different regions by doing a "select by attribute". I need to do this about 164 times because of the different selection ...
3
votes
2answers
167 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 ...
3
votes
3answers
80 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 ...
3
votes
2answers
89 views

Averaging XY data for locations in QGIS

I wanted to find out mean of the selected point using QGIS. I tried out selecting using attribute table but could not find an option for mean in field calculator. I have attached a screenshot with ...
3
votes
1answer
216 views

QGIS - Is it possible to increase Output Field Name?

When creating a new Column, the default value for the length of the name is 10. Using the Field Calculator via the Model Builder, I want to include the names of regional areas into the columns which ...
3
votes
3answers
1k views

Calculate Field tool to calculate on null fields

I'm using ArcGIS 10.1. I want to use the calculate field tool in ModelBuilder on a table where if field1 is null, it should take the value of field2. If field1 has a value then it should stay as is. ...
3
votes
1answer
1k views

How to use the field calculator's centroid() Geometry function in qgis 2.0?

There is an option in the field calculator for centroids under geometry which when you double click gives you "centroid( ". What information is required here in order to use this function?
3
votes
2answers
747 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 = ...