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
2answers
160 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 ...
3
votes
1answer
584 views

Calculate Field python code has “Expected end of statement” error

I am creating a line shapefile from a csv in a Python (2.7) script. I am assigning an ID field from the csv to a variable and then later using it in the Calculate Field tool. The ID field originally ...
0
votes
1answer
135 views

Problem in calculating length

I am Digitizing road line in India using open layer plugin.When I calculate the length of line using field calculator it gives me the result in millimeter . I thought it is the projection problem and ...
2
votes
3answers
726 views

How to count occurrences of one field grouped by values of another?

Is there a way of calculating the number of unique text strings in a field in ArcGIS 10.1? I have a number of repeated strings in this field, but would like to calculate the number of unique strings ...
2
votes
2answers
1k views

Use Feature Class “Name” from Iterate Feature Classes to Calculate Field with Model Builder 10.1

My goal is to create shapefile that contains merged feature classes from a geodatabase. I would like for there to be a new field in the resulting shapefile that contains the name of the original ...
5
votes
2answers
189 views

Field calculator script to work out first 5 dominant area fields?

I have 5 fields of different landcover types with areas of each and found below: > PRC_Water| PRC_Bare| PRC_Urban| PRC_LVeg| PRC_LVeg| > 5 20 40 20 15 I have ...
2
votes
3answers
830 views

Python script for identifying duplicate records (follow up)

I am trying to calculate a field that marks duplicates and sequentially numbers them. I am using the code below that I found here: Generating sequential numbering for duplicate values in a field ...
1
vote
0answers
788 views

Using multiple fields for a Reclass calculation in ArcGIS Field Calculator [closed]

I am trying to create a dummy variable from an existing dataset using ArcGIS's Field Calculator tool with a Python script. My conditions require the use of multiple fields to determine the output ...
1
vote
2answers
131 views

Creating a new integer field based on text in a different field - ArcGIS 10.1

I need to create a new integer field based on another text field. All instances of a the same text string in the existing field should be assigned the same number (starting at number 1). Can I do this ...
1
vote
3answers
546 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. ...
1
vote
2answers
312 views

How to use centroid option in Field Calculator in QGis

I want to use Centroid option in field calculator in QGis .How to access it?
2
votes
2answers
316 views

Is the derived area/length/xy values of a polygon/polyline layer in QGIS usable?

I have a raster that is projected to a state plane CRS and I am adding polygon/polyline shapefiles that are projected to WGS84. On the fly transformation is set to reproject to my raster CRS. When I ...
1
vote
1answer
182 views

Convert a number in attribute table to binary

I would like to convert whole integers from decimal to binary in ArcGIS using the field calculator. I am looking for the equivalent of DEC2BIN excel command. All values are 255 or below so 8 bit is ...
2
votes
1answer
357 views

Generating sequential numbering for duplicate values in a field sorted by ObjectID

I am trying to figure out a solution to an field calculation problem. What I'm trying to do is automatically (using either ArcPy or the Field Calculator) generate sequential numbers, beginning at 1, ...
1
vote
1answer
175 views

Stuck updating one field based on the condition of another using Acrpy or Field Calculator

I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with ...
5
votes
1answer
343 views

Translate Excel formula to be used in field calculator

I have a series of equations to create corner points to make rotated polygons based on angles in the attribute table, but I have created it in excel and can't figure out the syntax to get it to work ...
0
votes
1answer
210 views

Python: using CalculateField_management for duplicating attributes with a double quotation mark

I am writing a python script which duplicates a field. The field contains names of pipelines but some of these names has double quotation (ex. 8" NGL PIPELINE). I have created a new field and trying ...
0
votes
2answers
201 views

Field Calculate with a function written in python within a larger python script

I'm writing a python program where I need to field calculate using a python function. The function takes two strings; one used for an if statement and the other to become an integer complete a simple ...
2
votes
1answer
411 views

How to use Field Calculator to calculate area as percentage?

I am searching for python code to use in Field Calculator to calculate area as a percentage in relation to another field? The area percentage needs be calculated based on the total area for each ...
1
vote
3answers
157 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 ...
2
votes
1answer
150 views

Using Sum() or something similar with CalculateField_management and FieldLists

I need some help with using variables with CalculateField_management tool. I've tried several different scenarios but don't seem to have any luck. What I have is a list of fields containing water ...
1
vote
1answer
164 views

Comparing field values to update new field using ArcGIS for Desktop?

I am currently doing an analysis in ArcMap 10 using python. I have two shape layers, one is a point layer and the other one is a line layer. The point layer have attributes for point's unique ID, as ...
3
votes
3answers
182 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 ...
2
votes
2answers
58 views

How to flag parcels as being within stop type dependent distance of transit stops?

first question here! I have a parcel layer and a transit stop layer. The transit stop layer has different bus stops, light rail stops, etc. I want to add to my parcel layer attribute table fields ...
1
vote
0answers
55 views

How to measure area of polygons generated from gps data in qgis? [duplicate]

Somebody classified my question as a duplicate. But applying the answer doesn't work for me. Here is what I did: - I made sure that my layer is in a projected coordinate system (UTM30N, WGS84) - I ...
2
votes
1answer
184 views

Using update cursor on a field with a domain

I have been replacing field calculations with python update cursors in many of my work flows and today I ran into a problem. The fields being updated have an attribute domain. so now, when I ...
0
votes
3answers
287 views

Why does CalculateField set values to <Null> when output extent is in a different coordinate system?

I'm quite new to ArcGIS, and now I have to work on a script that goes through a list of feature classes to: add a field to their attribute table and fill that field with a number that I retrieve ...
1
vote
2answers
199 views

Stop rounding values in Qgis attribute table

I am calculating the areas of my polygons in Qgis using $area and everything works fine until I click on "save". All my values are rounded to an integer. I tired setting the output field type to ...
0
votes
4answers
157 views

How can I calculate different polygons by different attributes?

I'm doing my master thesis and want to calculate different polygons (in QGIS 1.8 for Mac) in four different columns which I defined by different attributes. i.e. some of the attributes in the first ...
4
votes
3answers
158 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
1answer
1k 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
1answer
113 views

How to write a expression in field calculator for finding $X and $Y?

I'm trying to calculate the lat/long of points using the Q GIS field calculator.Nathan W suggested to First, save the layer as WGS84 and import it again. Then in the field calculator you can use $x or ...
0
votes
1answer
66 views

Table calculation in QGis

I have a shape file with the attribute "yield". I need to know the math difference between yield (id1) and yield (id2)...then yield (id2) and yield (id3) and so on... I hope you understand what I ...
1
vote
1answer
959 views

ArcGis File Geodatabase with Null values (Field Calculator)

I want to use the field calculator to get the sum of a couple of columns. The problem is that some of them has Null Values. I am not able to find a solution. I tried this Python functions: stack( ...
0
votes
1answer
119 views

Trying (+ failing) to use a Function in Field Calculator

I'm trying to populate a field using a function. When I run this in Pyscripter, it works fine: d = {} # Function # def find_dups(val): d[val] = d.setdefault(val, -1) + 1 return d[val] # ...
2
votes
2answers
2k views

Using Value from Iterate Feature Selection to Calculate Field in ArcMap 10.1 ModelBuilder

I have two polygon feature classes, an alignment layer and a parcels layer. I am trying to use ModelBuilder to create a tool that will do the follow: iterate through groups in a single field of a ...
2
votes
1answer
181 views

Need a Python field calculation that works like the DatePart( ) VB Function

I have a field called Abandoned Year (short integer data type) that I am trying to populate with a four digit year from a column called Decommission Date (Date data type). I have done this in the ...
0
votes
1answer
251 views

How to calculate the area of the convex hull of a points layer

I have a shapefile in QGIS that I have created by importing a CSV of points, using Points2One to convert to a shapefile and then importing the shape. I am now trying to calculate the are of the shape ...
2
votes
2answers
510 views

Why is QGIS Field calculator button greyed out?

I'm using QGIS to attempt to calculate the area enclosed by a set of points that I have capture used a GPS device. I have imported the coordinates from a CSV but when trying to open the field ...
2
votes
2answers
281 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. ...
0
votes
0answers
44 views

( how to use Field Calculator to count number of duplicated recordes at another field? [duplicate]

How To Use the Field Calculator python script to count the number of duplicated records of a field "A" and get the count at another field "B"
1
vote
1answer
68 views

How to move a value from field1 to field2 using Field Calculator?

Hi I would like to move value in field1 to field2. Purpose is to after that delete the column 'field1' to get a better column naming standard /Jan
2
votes
1answer
65 views

using “abs()” function in QGIS field calculator?

I'm pretty new to GIS in general and I'm trying to take an absolute value of the difference between two fields in field calculator when creating a new field, but using ABS () returns an invalid ...
5
votes
3answers
1k views

calculating a field in which null values may be present

I would like to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have null values for one or more of the fields. For example, ...
1
vote
1answer
100 views

How to reach a field value of a record in field calculator in ArcGIS 10.1

I have two fields showing number of people in two age groups "young" and "old". these people also live in a cell (point) whose distance to a specific facility is calculated. then I categorized these ...
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? ...
0
votes
2answers
120 views

Stacking attributes in a text field

I am trying to stack my text in an attribute table using the field calculator, but it does not seem to be working. My field name is: Facilities. My attributes are in this format: Public ...
1
vote
2answers
436 views

ArcPy Field Calculation with special characters

I'm trying to calculate a string field, using "µSv/h". Running this in the manual field calculator works just fine, but I've tried this in the Python window in ArcMap as well as the IDLE, but both ...
1
vote
4answers
1k 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 ...
0
votes
0answers
213 views

python script to calculate and return values based on several conditions

I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid considering the attributes are species name, grid code, ...