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

Passing Value for Dictionary Look Up in Field Calculator fails [on hold]

I've a field calculator that I am trying to use that uses a csv file to look up appropriate value based on key that is passed provided to the function. As provided below, the only values calculated ...
0
votes
0answers
17 views

Field Calculator stopped working

The field calculator seems to have stopped working for one of my attribute tables (it works fine on others). No matter what I get it to express (I've tried simply 2*2, just as a test) it just produces ...
0
votes
1answer
281 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. ...
1
vote
1answer
43 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 ...
3
votes
3answers
1k views

Calculating X and Y of line start and line end using ArcPy?

I have a series of polyline shapefiles and I am trying to automate the process of calculating the X and Y coordinates of the line start and line end using Python. I have added the 4 fields (startx, ...
2
votes
1answer
38 views

Subtracting columns (that include null values) in ArcMap Field Calculator

I’m desperately trying to run a very simple command where I subtract one column with others. However the problem is that some rows have NULL values, therefore the result of subtracting is also NULL. ...
2
votes
2answers
27 views

Add both string and automated numbers in series to attribute table using field calculator

I would like to fill a column in my attribute table with an string that ends in a numeric value. Example: Object001 Object002 Object003 I would like to automate the process of filling in the ...
4
votes
1answer
232 views

Cannot compute area of shapefile in field calculator of QGIS?

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 ...
1
vote
1answer
153 views

Calculating values of field based on two others using Field Calculator in ArcGIS Desktop?

I need to combine two fields in an attribute table. I want to do this using the field calculator. What is the proper script to write to combine a field called "name" and "type", so that it produces ...
1
vote
1answer
42 views

how multiply a ranges of values for other value on python

I need multiply ranges>1.5 and <=4.5 * 9, but I am new in this type of language. please help me. def CalcD(Level_water) if Level>1.5 and <=4,5 * 9
1
vote
2answers
62 views

Using Python For a Field Calc

In AcrMap 10.2 I'm trying to add a field and run this script in Field Calc: !shape.isMultipart! to see if I have any multipart lines. I keep getting geoprocessing failures. I am clicking the ...
0
votes
0answers
25 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 ...
4
votes
2answers
4k views

Nested “if” statements in ArcGIS Field Calculator

The solution in VB for the base process is @ "If then" VB Script code (or Python) equivalent to SQL's IN ('x','y',z') expression in ArcGIS Field Calculator question? ...
1
vote
2answers
40 views

basic problem using division in field calculator

This is a very basic question, but I can't figure out what's going on. I've got election results I'd like to simply display as percentages rather than vote totals, which should be as simple as ...
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
4answers
101 views

Calculate Field with Python Issues (If statements)

I don't know a whole lot about python and scripting, so I was hoping somebody could give me a couple pointers on fixing some code. I am trying to calculate a "final results" attribute field. The ...
1
vote
1answer
47 views

Join and Field Calculator

I made a Join between a shape and a dbf, and now I want to calculate some data from the table that came as a result from that Join. Everytime I try to run the Field Calculator it says there's an ...
3
votes
2answers
74 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 ...
4
votes
4answers
278 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 ...
3
votes
1answer
86 views

Using arcpy and script toolbox to add the date to a attribute table

I would like some information on how to add a date to an attribute table, by adding a user specified date in a script tool that will update the polygons attribute table. In short I have two polygons ...
0
votes
1answer
36 views

What is expression for finding perimeter in ArcPy and Field Calculator?

What is the correct format for finding perimeter as an expression for arcpy. I was able to use expression !shape.Area! to find the area of my polygon. However when I use the expression ...
1
vote
2answers
121 views

What's wrong with this VB Script code for the field calculator in ArcGIS 10?

I am trying to use one field's contents ([Condition]) as a condition for populating another field ([Intact]). I try to run the following code in the Field Calculator, but it never works (and is not ...
2
votes
1answer
76 views

ArcMap Python Question: Trying to Field Calculate Slope Percent in to Text

I have a layer of polygons that I spatially joined to a raster to point layer of slope percents. My polygons now have the percent of slope in a field called Avg_point. I want to use the field ...
3
votes
1answer
76 views

How to use QGIS field calculator in python?

I would like to use QGIS Field Calculator in Python to update the existing column based on certain conditions? How can I do this?
1
vote
2answers
142 views

Syntax error from Python parser of ArcGIS field calculator if then?

Using ArcMap - I would like to calculate one field based on the value of another field. I want to Update the field 'Date_Class' based on the value in another field 'MIN_YEAR_B'. I was trying to do ...
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 ...
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 ...
0
votes
1answer
40 views

Building heights above DEM through field calculator

I have a series of building polygons which I would like to convert to a raster illustrating their height. I have the building heights but not their elevation above sea level datum. I have the ...
0
votes
1answer
22 views

Many ELSE statement in Expression in QGIS (2.6) [duplicate]

is it possible to have more than one ELSE in the CASE WHEN statement in the Expression builder in QGIS? For example: CASE WHEN "population" > 5000 THEN 'big' ELIF WHEN "population" > 1500 THEN ...
0
votes
1answer
26 views

How to populate new field according to string content of another field using VB script?

I want to populate a new field called Letting according to the string value found in another field. If 'ASP' or 'Q' is in field ExternalRE then I want 1 in Letting, everything else to be 0. Here is ...
1
vote
1answer
19 views

ERROR 000989 Issue with Python Script and Field Calculating distance between two long lat points

very new to scripting and I have been struggling with my script for a while. I'm not sure why it doesn't work in field calculator. I am trying to calculate a list of distance between two long lat ...
1
vote
1answer
173 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 ...
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 ...
0
votes
2answers
880 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
135 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 ...
0
votes
1answer
24 views

Copying the numeric portion of an address to a new field

I'm attempting to copy just the numeric portion of a street address into a new table using the Field Calculator in QGIS. The expression I'm trying to use is: left( "SITE_ADDR", strpos( "SITE_ADDR", ...
1
vote
1answer
33 views

What is the expression for getting a subset of characters in QGIS Field Calculator?

I have a column of 10 character names e.g. L3NAM1988K. How can I delete the first 5 characters and the last 1 character using an expression in the QGis Field Calculator?
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
21 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
56 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 ...
1
vote
1answer
48 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
45 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
1answer
51 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 ...
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 ...
2
votes
1answer
39 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
128 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
67 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
81 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.
6
votes
1answer
89 views

How to remove comma from combined fields which should be null?

I have Drivers License as one field and State as the other and there are to be combined and formatted as Drivers License, State. How do I handle records that do not have either a Drivers License or ...
1
vote
1answer
59 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..