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
109 views

Calculate field based on most frequently occuring text/value in other fields in attribute table (ArcGIS)

I was wondering if anyone knows if it is possible to calculate a field based on the most frequently occurring value in other fields. What I have is 5 fields with crop information over 5 consecutive ...
1
vote
1answer
1k 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
2
votes
1answer
55 views

How can I change all the entries in a field to be entirely lower case?

I have a field with a bunch of species names, but for a single species there a bunch of case combinations (e.g. Cat, CAT,cat). I want to make a new field which has all the entries in all lower case. I ...
2
votes
3answers
158 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. ...
0
votes
2answers
250 views

Model Builder Error populating attributes with Calculate Field

I would like to run a model that iterates over all feature classes in a feature dataset and uses the feature class name to populate an attribute field (see model below). However, when running the ...
0
votes
0answers
67 views

Field Calculator: Error message

Field Calculator: using the x- or yat or (0 "or-1" ) expression, I keep receiving an error: An error occurred while evaluating the calculation string: Index is out of range. I have shut down and ...
0
votes
1answer
225 views

Arcpy CalculateField using formatting syntax

I have 2 feature classes (FC) that I am merging together and then performing some field calculations on. The 1st FC has 100k+ records in it, and the second FC is a blank FC that I'm using as a ...
3
votes
3answers
427 views

How to create button that calculates acres on selected polygon features?

I'm looking to create a simple button that calculates acres on selected polygons and can't quite find what I'm looking for. I read through this thread: automating a python script..., but found it ...
3
votes
1answer
67 views

Do pad functions of QGIS Field Calculator have bug?

I have this expression in the field calculator: regexp_replace('1', '^(\\d+)', rpad('\\1', 3, '0') ) gives 01 rather than 001 as expected. the *pad functions work fine when called outside ...
2
votes
0answers
28 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 ...
1
vote
2answers
75 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
2answers
92 views

Iterate through each county in a shapefile, select the county and make a second selection by location - modelbuilder

The goal of my project is to create a table with two fields. The first field showing a county name and the second field listing every county that touches the boarder of the county listed in the first ...
3
votes
2answers
110 views

ArcGIS 10 Field Calculator [closed]

I'm new to GIS in general and field calculator in particular. I have a basic attribute table with three columns. I'd like to assign values to column C based on what is in column A. If Column A = 8 ...
3
votes
2answers
82 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
98 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 ...
4
votes
3answers
365 views

How to find/replace element in field with Field Calculator

I just want to perform the following operation done in Matlab into the Field Calculator using Python: p(p==0) = 0.001 ; p(p == 1) = 0.999; tVar = .5*log(p ./ (1 - p)) the operation consists of a ...
1
vote
1answer
56 views

Use field calculator in QGIS so get number of points in polygone and store it in attribute table

I have to layers, one point one polygon (with 6 areas) stored as shapefiles. Now I want to count the number of points in each area and write it into the attribute table of the polygons. A column ...
4
votes
3answers
157 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 ...
0
votes
0answers
164 views

New values created with QGIS field calculator become null upon saving

I'm having a problem with QGIS. I'm trying to create a new column in the attribute table for a shapefile. The numbers in the fourth column (see screenshots) are currently strings, so I want to convert ...
1
vote
3answers
545 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
2answers
229 views

How to add a new column in attribute table with attribute with indexes of another max-min ordered attribute field?

I've an attribute column named e.g. VALUE with different values I would like to make a column named e.g. ORDERsuch that the greatest value has the attribute 1 the second value 2 etc. etc. so order ...
1
vote
1answer
106 views

Problem in long expression in field calculator

I am trying to compute the following expression with Field calculator. The input table values are around the size of this value: 562643580,7843, and the field name (the field of destination) is: ...
2
votes
1answer
272 views

How to make autoIncrement number start with (001…009, 011…099)?

i have a challenge with my time in my work, i have feature class called "Parcel" storing many data, i generated an autoIncrement number by using field calculator, in field "parcel code" Expression: ...
2
votes
1answer
263 views

How to copy values from field to another using arcpy?

Can some one please let me know how I can do simple field calculation like Copying From "A" to "B" in ArcPy? I have found lots os example on web which they all used extra expression and they were ...
1
vote
1answer
221 views

Field Calculator returning incorrect length and area values

I can get accurate lengths of line features and areas of polygon features using the "Measuring Tool" in a QGIS project. However, when I attempt to generate length or area data in Attribute Tables ...
0
votes
0answers
74 views

Bug in Qgis 2.0 Field Calculator with Values from Joined table

I have a data of hospitals. I have two excel sheets, one has no of patients examined in each hospital and other has no. of patients treated in each hospital. I want to find percentage of treated ...
4
votes
1answer
92 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 ...
0
votes
0answers
65 views

Populate a new field with list of the top 5 values of all fields for that record

I have 15 fields. I would like to add a new field that is populated with the field name and value of the top 5 highest values of the 15 fields for each record in the table. The new field would be a ...
1
vote
2answers
733 views

How to fill attribute field of one feature based on calculation on attribute field of another feature

I would like to fill an Attribute field of a geodateabase table based on some calculations such as 'sum' over specific field of another Feature class. Is there an Approach to formulate it? while in ...
5
votes
1answer
67 views

Calculate difference between values in linear order using ArcGIS

The best way to describe this without knowing Python or VB jargon is to add these screenshots. I would like to emulate this Excel calculation in ArcMap10.1. MEAS is the distance along my route and ...
1
vote
1answer
65 views

Mismatch in area calculation using Field Calculator vs Group Stats in QGIS 2.0

I have two polygon files (A being my area of interest and B being a categorised land cover layer). Both layers were in the same projection (projected and not geographic). Using QGIS 2.0, I used the ...
0
votes
0answers
14 views

Unique referencing based on Co-ordinates

I have a list of 400 nodes, all split across 'maps' which are gridlines 1000x1000m. Each grid area is referenced by the first 3 digits of the X value of the centre and first 3 digits of the Y value ...
3
votes
1answer
199 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 ...
4
votes
2answers
81 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, ...
2
votes
2answers
120 views

Field Calculator, Conditional

I am trying to assign Value from one field of my Attribute table to a new field based on the 3d field.... The Code Block I am thinking about as follows: *def conditional (!FarmCateg!): if ...
0
votes
1answer
170 views

Field Calculator - replace string function - data value recognised as a column and is “not found” [closed]

I have the same challenge as GrahamD - Field Calculator - replace string function I have exactly the same challenge. Exactly the same as GrahamD's challenge, p abbreviated for pan. Type_2 as a test ...
0
votes
1answer
106 views

Is it possible to calculate a value based on values of another row?

I have a point shape file in qgis. For one of the attributes, I would like to offset the values, i.e. the value for point 1 goes to point 10, the value for point 2 goes to point 11 and so on. I see ...
1
vote
1answer
163 views

Is there a way to automatically calculate attribute values for new features?

I am creating a vector point layer which will be added to over time. I have been using the field calculator to populate fields such as X and Y coordinates. I'm wondering if there is a way to have ...
3
votes
2answers
444 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) ...
1
vote
2answers
214 views

VBA ArcGIS 9.3 Field Calculator: 'countif' across several fields

I have an attribute table with 15 columns that contain either a '0' or a taxonomy number. I would like a summarized column that shows the number of different species. location type1 type2 type3 ...
2
votes
1answer
89 views

Populate an attribute table field using the 'startswith function

I am hoping that someone may be able to help me. I am new to ArcGIS, and even newer to Python. Working in ArcGIS 10.1, I have done is created a new text field in an attribute table, which I have ...
3
votes
2answers
236 views

How to create a label formatted like “ 1,000' ” from a numeric field?

This question builds on a previous question I came across at gis.stackexchange: How to easily edit attribute data using Regular Expressions? Perhaps someone can point me in the right direction? I ...
1
vote
2answers
304 views

How to write a QGIS regex for rounding to two places after the decimal point?

In QGIS field-calculator round() is not working in QGIS 1.8 so I try to do the following with a regex: I'd like to keep the first two places after the decimal point - where do I go wrong? ...
1
vote
3answers
542 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. ...
0
votes
0answers
183 views

Select Expression and Field Calculator in ONE STEP with QGIS

I have an Open Street Map Shapefile and i want to use Field Calculator to add information to a field called a800900 according to the field TYPE of street, by different area (field called ID_2). The ...
4
votes
1answer
471 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 ...
1
vote
1answer
155 views

Help with field calculator in Python script

I am getting a syntax error in my script but I know from testing it in ArcMap attribute table, the syntax is fine. Anyone have any idea why this code doesn't work? I see that a search cursor has been ...
1
vote
2answers
176 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 ...
0
votes
0answers
98 views

Doubt in Field Calculator

I am working in an project.I have a point Shapefile its projection is NAD83(HARN)Pennslyvaniasouth(ftUS)*EPSG3365* when I measure its distance(between two points) it gives me the answer in feet .yes ...
5
votes
4answers
669 views

How do I fill in serial letters (AA, AB,AC…,BA,BB,BC…ZZ) to a shape?

(I am using ArcGIS software, ArcMap...) MY PROBLEM I have a shape file containing points. The shape file contains 3 columns named FID, Shape* and Label. In the column I want to fill in AA, AB, ...