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

0
votes
0answers
19 views

Field Calculator QGIS: CASE WHEN

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
59 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
102 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
77 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
61 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
45 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
17 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
52 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
48 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
93 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
43 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
129 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
43 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
104 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
39 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
96 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
64 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
69 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
81 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
34 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
17 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
157 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
68 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
137 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
109 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
120 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
64 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 ...
1
vote
0answers
82 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 ...
2
votes
2answers
132 views

How to calculate area of shapefile with a merged layer

so i have 'save as''d the new project and layer with my new Custom CRS project string being '+proj=laea +lat_0=70 +lon_0=0 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'. ...
3
votes
2answers
110 views

How I can reverse numbers in a string without reversing any text? [closed]

I have a string, I need to reverse just the numbers in the string without the text: String: [321 test] The result will be: [123 test]
7
votes
1answer
135 views

Meaning of exclamation mark in Python parser of ArcGIS Field Calculator?

In the following line, I don't understand what those exclamation marks mean? And why put everything in quotation? I don't understand the purpose of the variable expression, please explain to me as I'm ...
1
vote
1answer
77 views

How to calculate unique IDs starting from highest current ID

I have been using a python script in field calculator in ArcGIS 10.2 to add unique IDs automatically, however there are two things I would like to improve this process: Each ID also has letters at ...
1
vote
2answers
57 views

How to concatenate double with string in field calculator with Python expression?

I'd like to concatenate my lat/lng with a few string fields in ArcGIS. What is the correct expression to use, avoiding VBA. I don't want to convert the lat/lng fields to string either. my 4 fields ...
1
vote
3answers
72 views

If/then Field Calculator

I have two fields in my model, the first is a spatial join return for the township, the second is a spatical join to a city. If there is not city, then the field is left blank. The column that has ...
0
votes
0answers
37 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 ...
3
votes
1answer
90 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 ...
1
vote
2answers
91 views

Concatenating text and string in Field Calculator expression (python)

I'm trying to copy an attribute value from one field to another (sum of raster values), but I'm having issues in writing a functioning expression for a Calculate Field script. I'm adding a field ...
3
votes
1answer
127 views

Why is this field calculator expression evaluated incorrectly when using Python syntax?

I have a polygon featureclass containing an integer field 'gridcode'. I've added 2 new float fields VB_calc and Python_calc, both of which should be equal to gridcode / 1,000,000. If I calculate the ...
2
votes
1answer
62 views

Concatenate multiple string / text fields some of which may have NULL values ArcGIS

I am trying to repeat the behavior of this code from the ESRI website. I want to replicate the output example in ALL_Type field, so that it concatenates a field but it deals (ignores) any that have ...
1
vote
1answer
60 views

Calculating Field B from Field A, except where Field B has existing value, using ArcGIS Desktop 9.3?

Im trying to calculate Field B from Field A except where Field B has existing value in ArcGIS Desktop 9.3. (I suspect its straight forward but I have 'searched' and havent cracked it yet) Any ...
1
vote
1answer
62 views

Calculation of a text value, The value of which is separated by a special character

How can I calculate a text value, the value of which is separated by a special character? For example: dog | duck, I would like to keep the first value: dog or elephant | cat, I want to keep ...
3
votes
1answer
315 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 ...
2
votes
1answer
58 views

How to convert unix time to qt time type?

How can I convert unix timestamp to qt time type using qgis field calculator? I would like to avoid importing my table into excel and convert the timestamp to qt time type.
2
votes
1answer
165 views

Python Syntax Error when running Python Snippet of successful geoprocess

I am having an issue with a simple python snippet. Here's the background: I wanted to include an additional step in a nightly update script that replaces characters in a field that simply do not play ...
4
votes
1answer
96 views

Calculate Field in ModelBuilder gives General error executing calculator. ERROR 999999: Error executing function. Expected end of statement?

I am attempting to do zonal statistics for multiple images and I need to add an extra field that will have the name of each raster file in each row to the finally appended file. I have added a field ...
0
votes
1answer
68 views

Field Calculator If/Then in ArcGis 10.1

I've been looking through these threads, i found something similar and thought it could be the answer, but it doen't seem to work for me... I could do this the slow way with Select By Attributes, but ...
1
vote
0answers
81 views

Cause of Field Calculator UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 5: ordinal not in range(128)? [closed]

def Befahrung(value1,value2): if value1 is ' ': return ' ' else: return "G:\\Example\\" + str(value1) + "\\File_" + str(value2) + ".pdf" I try to create a field with a hyperlink. It works ...
2
votes
3answers
228 views

Setting Zero values back to NULL

I'm working with ArcGIS 10.2 for Desktop and OS Windows 7. I need to set numeric vales from Zero back to NULL, but I can't from the field calculator. I'm working with a vector file and I need to ...
0
votes
0answers
57 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 ...
3
votes
0answers
79 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 ...