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

0
votes
2answers
877 views

ArcGis Python Script, Calculate Field

Sorry for my English. I am trying to write a Python Script for ArcGis 10.2. #import system modules import arcpy import math from arcpy import env #Set environment options ...
4
votes
1answer
134 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 ...
3
votes
1answer
108 views

How to calculate the intersected area from a layer with overlapping buffers in qgis

I need to calculate the area of landusetypes in 50m around various dots (all in one shapfile). My problem is, the buffers around the dots are overlapping each over in some places. I tried to ...
3
votes
1answer
79 views

How do I add a field to a table using the QGIS graphic modeler?

I was wondering if anyone could help as I'm struggling to get anything out of the QGIS graphic modeler. For info I have no programming skills whatsoever. I need to be able to add a new field to an ...
2
votes
1answer
74 views

Randomly choosing one from multiple fields in Field Calculator of ArcGIS for Desktop?

Using the Field Calculator in ArcGIS for Desktop, I want to randomly choose one field from a list of 10 fields (strings). The Excel equivalent, which is working, is: =INDEX(A2:J2;rnd()*10+1). How ...
2
votes
1answer
1k views

Getting ValueError: max() arg is an empty sequence on a Python Script in the Field Calculator in ArcMap

I have a script that populates a FacilityID Field on a Attribute table in the Field Calculator but when I run the script below I am getting a error. EDIT: Python Script: def autoInc(): import ...
1
vote
1answer
41 views

Use value of Field in Calculation in Modelbilder

In Modelbuilder I have set up a model, where in one step I do a "Calculate Field" like "round((!OID!-1- %MyField% /15)/452,1)+1" . For the calculation i use the value of %MyField%, which actually is ...
1
vote
1answer
35 views

Categorizing GPS data based on cumulative time using ArcGIS Desktop?

I have GPS data which includes “Lon”, “Lat”, and cumulative Time from 0 (sec) as fields. I want to add an integer variable new field, “Trip,” which starts from zero, and is incremented by one after ...
1
vote
1answer
67 views

Concatenate fields value excluding empty values

I need to concatenate the value of two fields excluding empty values, using Field calculator. The fields are: AREA_HI and AREA_LO I have tried using a Python script but ArcGIS returns an error ...
1
vote
1answer
64 views

Calculating average of 3 fields where nulls are present

I have created a new field to calculate the average of 3 other fields in a table where nulls are present. Using python as the parser(with no code block) I used this: (!Slope_PCT! or 0 + !Flood_PCT! ...
1
vote
1answer
172 views

How to create sequential field based on sorted data? (or extract pop-up data?)

I downloaded a kmz field and converted it to a GDB fc on arcmap. However, the field I need to label the layer by is stored in the pop-up html field... It looks like this: <html ...
1
vote
1answer
317 views

Calculating Stream Length-gradient Index (Hack Index) with the field calculator

I'm trying to calculate the Stream Length-Gradient Index of a stream (example data below). Just started to get into python, but am struggling with a solution to this problem. I have 42 streams to run ...
1
vote
1answer
68 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
1answer
25 views

Is there a way to automate field calculations for ArcGIS Server?

I have a field that I'd like to be concatenated with each new objectID when a feature is created in my feature service. Workflow: Feature added, already contains objectID. Would like my Service ...
0
votes
1answer
278 views

Join and Calculate vb.net

Im trying to join an excel table to a shapefile and then calculating those fields using vb.net. The code I have written has no errors, but won't work when I try it in ArcGIS 10.1 and I'm out of ideas. ...
0
votes
1answer
46 views

Formatting Cells in ArcMap

I am trying to join tables together and need the PLSS to line up correctly. In my table with geometries I have "CO060020N0650W0SN330" in a field. I want to make a new column and make it say 2N65W33 ...
3
votes
0answers
110 views

How to calculate percentages using QGIS field calculator expression?

I am new to QGIS. I am wanting to calculate a field using other fields and some operators. Here is my expression: case When "RVM_CAT" = 'B' OR "RVM_CAT" = 'C' Then ("PC1" /100) * "RE_ha" When ...
3
votes
0answers
64 views

Can you use wildcards for column headers in Field Calculator?

I know you can use wildcards for fields like so (in the Field Calculator): case when "column" ILIKE '%example%' then 1 else 0 end Can you do something similar for the column headers themselves? I ...
3
votes
0answers
69 views

Using Field Calculator to Convert Data Type In Field

I am trying to convert a field that is listed as "String" because it was imported into QGIS as a CSV (rural poverty population percentages by county in NC). I need to convert the percentages field ...
2
votes
0answers
51 views

How to add column to attribute table using field calculator with $length function?

I used the following code to add a separate column to the attribute table with the length of features. from PyQt4.QtCore import QVariant from qgis.core import QgsField, QgsExpression, QgsFeature ...
1
vote
0answers
15 views

Trying to export stacked text to CAD using ArcGIS 10.2

I've been experiencing some unwanted results when trying to export stacked text to CAD using ArcGIS 10.2 for desktop. With the Export to CAD tool I can easily export polygons. However, I'm also trying ...
1
vote
0answers
39 views

QGIS field calculator expression: selecting min/max values within field groups

I am new to using QGIS (previously used Arc) and trying to get my head round the expressions and Python. I have series of polylines representing routes and require the linear distance from the ...
1
vote
0answers
49 views

Geometric functions in field calculator in QGIS

I had a look in the manual of QGIS and I also browsed the Internet to find some useful information about the geometric functions of the field calculator. I've found this post but I'm still confused. ...
1
vote
0answers
101 views

Cumulative field calculation using Python in ArcGIS for Desktop?

I am using the following Python code to sum cumulatively but I need the summation to take place while the other field is equal to 1 and then again start the summation when it's equal to 2. I need the ...
1
vote
0answers
21 views

Can a joined-layer have its attribute changed depending on what layers are selected/deselected?

Using QGIS, I have a polygon-grid layer which covers everything, Layer_All joined with 2 other grid layers: Layer_1 and Layer_2, both of which intersect at various points. I would like Layer_All to ...
1
vote
0answers
89 views

VB Script can't run in Field Calculator

I wrote a simple script in VB. But it failed to run in field calculator. I can't figure out what is wrong with it. Below is a screenshot. Thanks for your help.
0
votes
0answers
23 views

How do I auto-populate more than one other attribute field with values based on the value of another field within the same record?

Based on value selection from one attribute field, would it be possible to auto-populate many fields within the same record with predefined values either from a range of values within another field or ...
0
votes
0answers
99 views

Python script to get feature count in a feature class that fall in a specific range

I need to write a Python script to be used in the ArcGIS Field Calculator that will return a feature count for values between a range defined by the values in two other columns. Here is a graphic ...
0
votes
0answers
77 views

Why will my field calculator python function always return Null if any inputs are Null?

I've written a simple python function that outputs a list based on yes/no fields. It appends a word to a list if it has a "yes" in another column then writes the list, formatted according to the ...
0
votes
0answers
47 views

Concatenate an object ID and string to publish gp service with field calculator?

I have a simple model which concatenates and object id and a string, to create something like 1SRS2567, the concatenate function of OID and the string field are able to be passed in VB, but not ...
0
votes
0answers
66 views

calculating decimal degrees from coordinates found in an excel table

What is the exact syntax to use when calculating decimal degrees in the field calculator? I know the general formula {i.e. Degree + (minute/60) + (second/3600)} but how do I put this into the gis? I ...
0
votes
0answers
36 views

Field is not nullable but Field is nullable Box is checked

I had this problem already a couple of times. I add a Field (float) to an existing feature class, the Field is Nullable is arleady checked. But performing a calculation with the Field Calculator on it ...
0
votes
0answers
129 views

Using Code Block in Field Calculator with ArcObjects (VB.NET)

I'm having trouble using a code block in the Field Calculator with ArcObjects. Ideally, I'd like to be able to read a text file which contains the Python code for the code block. I've tested this code ...
0
votes
0answers
45 views

Calculating rows in a attribute table of a point shape with QGis or Saga

I have a point shape with an attribut ("test"). I need to calculate the sum of the 1st four (id 1-4) "test" values and then the next 4 (id 5-8). Is there a chance to calculate this with the field ...
0
votes
0answers
159 views

ArcGIS Python Field Calculation

Ok so i've got a problem with the field calculator in ArcGIS: I'm already pretty far with it since i got some help :P but it still doesnt work. What i've got: -A complete table of several states of ...
0
votes
0answers
73 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
0answers
237 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 ...
0
votes
0answers
80 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 ...
0
votes
0answers
67 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 ...
0
votes
0answers
192 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 ...
0
votes
0answers
102 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 ...
0
votes
0answers
265 views

Using Field Calculator to Calculate a Mean for Multiple Rows

I am trying to calculate a mean across a multiple number of attribute rows and have this value added to a new field that I have entered in the attribute table. I have an attribute table which has a ...
0
votes
0answers
100 views

Import csv file and use “toggle editing” and “field calculator” without Saving it as a Shapefile.

I am importing a .csv file in QGIS and I have also made the *.csvt file where I have specified my data types. I still cannot use "Toggle editing" and "field calculator".Whether I must save it as a ...
0
votes
0answers
227 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, ...
0
votes
0answers
26 views

I need to add one table to another table as strings.

But all of this two table data is numeric. And one of them is float. So I need to add from the float table only integer and merge it with other table. What to write in field calculator?
0
votes
0answers
449 views

How can I get shape filename in attribute field using field calculator with VBA?

I want to store ths shapefile name in an attribute field using the field calculator and visual, but can't find the way to do it. Can anyone help me, please? Thanks!!!
0
votes
0answers
68 views

How to populate polygon extents to an attribute table in QGIS

Is there a way to calculate the XMIN, YMIN, XMAX and YMAX of a polygon and write it to a field in an attribute table? The Geometry functions available in the Field Calculator are for points. ...
-1
votes
0answers
35 views

Creating a unique ID for Object ID's

Does anyone know how to create a unique ID, in another field, for the existing oblect ID's? For example the Object ID is "1" I simply want to make it"1A". I am looking for a script or code that would ...