Tagged Questions

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
0answers
22 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 ...
0
votes
0answers
20 views

Python script to get count of features that meet a certain criteria [duplicate]

I am in search of a Python script for use in the ArcGIS Field Calculator to return the number of features that meet a certain criteria. Here's where I am getting stuck: def ...
0
votes
1answer
40 views

Is it possible to have auto-updating area fields?

I'm using QGIS 2.4.0 and I've noticed some problems with the derived area and the $area field. Firstly, I have a polygon which is a filled ring, inside another polygon. The derived area, and therefore ...
0
votes
0answers
80 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 ...
-1
votes
0answers
12 views

Unique ID's for ObjectID [duplicate]

So basically I have a raster image that has been grided to make digitizing more organized.I used a fishnet,and the grids are numbered in the OID field from 1-304. I wanted to create another field ...
-1
votes
0answers
29 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 ...
1
vote
1answer
36 views

Calculate field in model builder using file name

I have browsed answers to similar questions but I still cant figure it out. I have created a new field called "namemonyr" in all of 646 shapefiles. I now want to populate that field using ...
2
votes
1answer
38 views

Add or subtract days to date field using the field calculator

I am using ArcGIS 10.1 I'm not a programmer I want to use the field calculator to add 4 days to the current date if the status is "delivery" or subtract 5 days if its status is "order" this ...
1
vote
0answers
25 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
1answer
41 views

How to calculate distances in QGIS field calculator?

So I'm using qgis 2.6.0 and I have a csv (converted into a .shp) with two geometry columns, I want to create a new column with the distance between the two geometry: shot.lat shot.lon haul.lat ...
2
votes
1answer
28 views

Converting Aspect degree to westness

I have extracted Aspect values in degree from DEM in ArcMap 10.2 full license. I want to investigate effect of Westness in my model so I was using conversion formula of Folded Aspect : ABS (180- ...
3
votes
2answers
116 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?
1
vote
1answer
44 views

Calculate value from an equation using Field Calculator Python/VB Script

I wanted to calculate a result value from 3 fields using an equation. VBScript or Python codes are also accepted..:-) the equation is RESULT= [(R^2/3)(S^1/2)]/n..
1
vote
1answer
40 views

Using if else statement in Python Parser of Field Calculator in ArcGIS for Desktop?

I need help in writing the python script in the field calculator. I have three fields namely: CODE COMPLEX Map1 Map1 is an empty field that I want to populate. I have a number of conditions to cater ...
1
vote
3answers
113 views

Field Calculator - How to evaluate and sum multiple fields?

I'll do my best to describe the problem - my main issue isn't so much the python code but rather the logic I'm using. The file I'm working on is a polygon shapefile with forest attribute data. In the ...
0
votes
1answer
74 views

Calculate Field based on two fields using python

I'm trying to calculate new values for a field based on two other fields. In VB I don't have any problem, but I need to use python to publish my gp service.
2
votes
1answer
83 views

How to create a Qgis python script to manipulate fields with some parameters?

I'm just beginning with QGIS. I have a shape file with 10 fields field1, ..., field10, and many thousands of data. I will like to automatize the next sequence (in a python script or a model): load ...
1
vote
1answer
34 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 ...
2
votes
0answers
47 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
1answer
50 views

Remove Leading Zeros with QGIS Field Calculator

I'd like to take this attribute value: "MAP_PAR_ID": "0160011000", and populate a new field with "16-11". This works: concat(substr("MAP_PAR_ID",0,3), '-', substr("MAP_PAR_ID",5,3)) but i need to ...
0
votes
1answer
57 views

Using Field Calculator to fill out a list of unit numbers

I am adding address points for individual units in trailer/RV parks and I would like to be able to use the Field Calculator to assign the unit numbers. Is it possible to tell the Field Calculator a ...
1
vote
1answer
61 views

count how many times an attribute is repeated, using “field calculator”

I'm using Arcgis 10.2.2 there is a way to count how many times an attribute is repeated, using the "field calculator" to make a selection after example of repeating more than 20 times
2
votes
1answer
41 views

Referencing fields in code block of Field Calculator in ArcGIS for Desktop?

I'm trying to use values from a field to fill a new field with a truncated version. The 'str.rindex' function is working out well, but I can't seem to figure out how I'm supposed to reference the ...
1
vote
0answers
29 views

Field Calculator QGIS: CASE WHEN [duplicate]

at first, sorry for my English. I'm using Google translator. I have a .shp file with attribute table. Like this... -- A -- -- B -- -- C -- QString Double Double Data ...
3
votes
2answers
65 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 ...
1
vote
2answers
120 views

Field Calcuator to add percent using Python

What might I go wrong here is that I am trying to add percent. I use the Field Calcualtor and it keeps getting an error. I am opening the Table to add a field named Percent and then type this: ...
1
vote
1answer
81 views

How to work with accentuated strings in Python scripts in ArcGIS Desktop Field Calculator?

` pre-logic: def myCalc(name,nameVal): if (name == nameVal): return 1 else: return 0 var_name= myCalc(!Epulettipus!,"Lakóépület") ` This doesn't work with accentuated strings. (But ...
0
votes
2answers
92 views

Writing Python script in Field Calculator in ArcGIS Desktop?

I'm a programmer, I have programmed in C#, Java, but not with Python. And I'm not a geographic worker. How can I write a python script into Field Calculator to be able to check the other column value. ...
1
vote
1answer
57 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 ...
0
votes
1answer
20 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 ...
3
votes
3answers
79 views

Calculate field using variables as fields

When I calculate a field like this: field_0="field_name0" arcpy.CalculateField_management("Layer", field_0, '!field_name1! / !field_name2!', "PYTHON_9.3") It works! The field "field_name0" in the ...
0
votes
1answer
68 views

Painfully slow performance with Join and Calculate Field

I have a point layer and a table with approximately 100 fields. I need to join the table to the point layer based on a key field and create a new shapefile / feature class. This script has been ...
2
votes
1answer
128 views

ArcGIS 10.0, Field Calculator Nested “if” statement with strings

I need to assign a value depending on other two columns "FNP" and "Teilort". I wrote this script in phyton for field calculator. It actually works (no error messages) but the results in every cell is ...
1
vote
0answers
47 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. ...
6
votes
2answers
140 views

How to delete last part of a string starting from the 1st non numeric character? [closed]

I'm looking for a Python or VB statement to remove the last part of a string, starting where the 1st non Numeric character appears, using the Field Calculator in ArcMap 10. Here's an example of what ...
3
votes
1answer
46 views

Iterate calculate field in multiple tables in ModelBuilder

I would like to iterate calculate field in multiple tables using ArcGIS Model Builder. The figure below explains details of the calculations. My existing model calculates value only for the first ...
2
votes
2answers
106 views

How to handle “Error: Town not found” when updating an existing field with Field Calculator?

I want to update a field in field calculator. update existing field is checked. Column to be updated : Column2 CASE WHEN "COLUMN1" IS NOT NULL THEN "COLUMN2" = "Town" ELSE ...
0
votes
3answers
44 views

How to flip, or invert attribute tables with respect to row ID arcgis

I need to invert the fields of an attribute table relative to the row ID field. As a very simple example of what I need; if the row IDs of 1, 2, and 3 corresponded to identical values in another ...
0
votes
2answers
116 views

How to replace “NULL” value with Zero in geodatabase table

I am having some difficulties to change "NULL" values to zero in geodatabase. I have tried the following python code in ArcGIS 10.1 ("Field Calculator") to change it but did not work. Pre-Logic ...
2
votes
2answers
68 views

ArcGIS Field Calculator passes European-formatted floats as tuples

I have the problem that the ArcGIS Field Calculator doesn't read a float number when it is included in Python by referring to the field that contains it, in this way: def giveResult(floatValue): if ...
0
votes
2answers
82 views

How to calculate cumulative decreasing sum in ArcGIS-10.2

I need to calculate the cumulative decreasing sum as a field in a rasters attribute table. The cumulative decreasing sum is the accumulation of the last values to the first, so it is basically the ...
2
votes
2answers
85 views

Returning value from other field, using FieldCalculator

I am very new to Python and need what I believe is a very basic script in order for my field to represent another fields' input, if the field's value is 0. I tried to search for this, but gave up ...
1
vote
1answer
45 views

How to Calculate Cumulative Field Values in Arcmap

My problem is conceptually quite simple; In Arcmap 10.2, I wish to create a field which contains the cumulative values of another field in the same attribute table. For example, if the first three ...
2
votes
1answer
21 views

How to calculate square footage from multiple records into one field?

I want to add up the square footage for each building floor and enter the total into another field within the same feature class. Each floor has a different size and is a separate polygon with a ...
1
vote
2answers
181 views

Calculate Fields with Null Values using arcpy.da.UpdateCursor of ArcGIS for Desktop?

How do you calculate fields with null values? I have multiple fields that may have null values, that aren't being calculated in the third field. import arcpy with ...
3
votes
1answer
73 views

Trouble calculating areas in QGIS using field calculator

I am testing various projections to calculate areas using ICES statistical shapefiles and the QGIS field calculator. I am using ICES areas downloadable from the following link: ...
5
votes
1answer
141 views

How do I extract partial data from one field to another?

Answer Below I am attempting to extract a date stamp that is contained in one field and insert it into another field. The issue is that the date (in bold below) is not in the same location in each ...
2
votes
4answers
124 views

Field Calculator Python Expression Issues

I'm pretty new to Python and this is my first post on this forum so I could use some help. I am currently attempting to run some code in the Field Calculator in a model in order to replace string ...
1
vote
1answer
150 views

Simple field calculator equation in ArcGIS 10.2.1 not working with python parser

I am trying to calculate a percentage in a field in a table. customers and total_customers are short integer fields. arcpy.AddField_management(tableSepSel2, "percent", "DOUBLE") ...
0
votes
0answers
66 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 ...