Field calculators (available in QGIS, ArcGIS Desktop, etc) can recalculate the values of a single field on all, or selected, records within a table using an expression.

learn more… | top users | synonyms (1)

2
votes
1answer
51 views

Help with else/if else in arcMap? [closed]

I'm attempting to create quick code that simply assigns a gps coordinate to a certain station on the map. Here's my current code Pre-logic script code: def update_nones(lat,bay_statio): if bay_statio=...
0
votes
1answer
67 views

Getting different values for area field calculations using ArcGIS Desktop?

We have self developed application based on ArcGIS 9.3.1 SP2. Our agents use that application to edit parcels. The parcel layer has a field SHAPE_AREA that is calculated by ArcGIS. Our application ...
3
votes
2answers
111 views

Using ArcGIS Desktop field calculator (python) to parse date

I'm trying to parse a datetime field using python (but have never used python for it before). I have a field that contains a valid date, but not a valid time... and other fields that have valid hour ...
0
votes
1answer
39 views

ArcGIS 10.2: VB to Python

I have the following VB code to produce a percentage in a field calculator. " [FIELD_1] / [Total]*100 " It works in VB. I've tried the following without luck. !FIELD_1! / !Total! * 100 Can anyone ...
2
votes
3answers
209 views

Unable to replace Null values using Python parser of ArcGIS 10.0 Field Calculator?

I'm using the following python code to replace Null values by 0, using field calculator: def nulls(p1): if p1 is None: return 0 else: return p1 But nothing happens, Null values stay. I'm ...
3
votes
0answers
68 views

ArcGIS 10.0 Python script won't recognize null [duplicate]

Has anybody ran into in issue where Python field calculations and/or scripts won't properly query Null (None) values? The calculation I'm working on is a little more complex, but even the simple ...
2
votes
1answer
48 views

Using Arcmap to update a field based on data from another fields

I'm trying to update latitude and longitude data per individual station for a lab I'm working for. Here's some code I have that's supposed to assign any all bay stations of a certain name the ...
1
vote
1answer
57 views

Using python to do a interpolation on field calculator [duplicate]

I need to increment a row in attribute table: def func (w,v,pot): return pot + ((pot+1 - pot)/(v+1 - v))*(w-v) The "+1" is not the addition of number one to the variable, is the intention to ...
1
vote
1answer
40 views

A script to populate a numeric field in Arcgis based on some content of a string field?

I have field in an attribute table populated with expressions like "6S2Olch1E", "10S1B", "9B3S2Olch" and so on. I need to make a numeric filed populated with only numbers associeted with letter S from ...
2
votes
1answer
56 views

Calculate field using data from excel table

I need to interpolate data that I have in a excel file using data from an attribute table of a point feature. I want to create a new field on the attribute table with the result of that interpolation. ...
0
votes
1answer
242 views

Writing expression syntax for Calculate Field in ArcPy?

I'm stuck on my CalculateField function with how to correctly type the syntax. I'm not particularly tied to the variables I assigned up front. The issue is syntax for the expression. I am ...
1
vote
2answers
118 views

Removing extra string from text column in Attribute Table to make numeric column from number part using ArcGIS Field Calculator?

I received a shapefile about invasive species. I am using ArcGIS 10.2 for desktop. In Attribute Table, there is column called "Infested_Area" and its got number mix with text, for instance "9100 sq ...
2
votes
1answer
131 views

Calculating percentage using QGIS Field Calculator?

I have a shapefile containing counties and their respective population for a given area. I woould like to use the Field Calculator to create a new field that contained the % of the total population in ...
0
votes
0answers
12 views

Calculating Grid square page names using loops, counters/cursors [duplicate]

I've created a large grid of 1 sq-mile cells to use for QC projects at my job. I've given each row a letter ID, and each column a number ID. So the grid starts with A01, goes to A02, etc. Next row ...
3
votes
1answer
81 views

QGIS field calculator returning results in different units?

I am trying to use QGIS to get the perimeter, area, bounds width, and bounds height of US congressional districts, using the US Census TIGER shapefile. I loaded the shapefile into QGIS, set my CRS to ...
1
vote
1answer
321 views

Passing two variables into codeblock of Calculate Field tool of ArcGIS Desktop?

I have a script tool that truncates each word in field to 3 characters and outputs the result in a new field: "THIS IS AN EXAMPLE STRING" becomes "THI IS AN EXA STR" import arcpy arcpy.env....
2
votes
1answer
133 views

Create list of [X, Y] coordinates within field calculator

Lately i've been working on a script that must calculate a value in ArcGIS field calculator based on all vertex coordinates of a polyline. But i am struggling to create a list of a polylines ...
0
votes
1answer
65 views

calculate specific rows and populate their result in another field

I'm working on ArcGIS 10 desktop version. I have a file with one entity entered multiple times (rows) and each time that has been given a new value against it. I want to sum the values against this ...
0
votes
1answer
37 views

Updating Values in FIelds of ArcGIS editing only portion?

I have total 96 records which are having duplicate values like 999999. What i want is to convert these values into unique ones like 999901,999902,999903 and so on, through the 96 records. I want ...
2
votes
1answer
134 views

Convert Field Expression to ArcGIS Python Script Tool

I've created the following field calculation that I'd like to convert to a python script tool: def blocklow(a, b, c, d): mylist = [a, b, c, d] # create list from input range variables if mylist =...
0
votes
0answers
52 views

Concatenation of fields with if or when circumstances

I have a field named PROJECT_DESCRIPTION that concatenates the STREET_NAME, FROM and TO fields. Sometimes the FROM or TO fields are only address ranges. In my PROJECT_DESCRIPTION field I would like to ...
2
votes
1answer
84 views

Selecting numbers within the slash (/) using ArcMap Field Calculator?

I have date data that I'm separating into three separate fields (all fields are string type, including the input field) by day, month, and year. Unfortunately, the date field is raw data and isn't ...
0
votes
2answers
160 views

Find minimum in a column of attribute table using python on Field Calculator

I have a column X in attribute table where the values are repeated in some lines. What I need is to make a condition that says: when the values in column X are the same, find the minimum of column Y ...
1
vote
2answers
80 views

Extracting a Feature Class' Name, and Adding It to a Field

I'm building a bike network dataset based on an existing street network. Each bike lane/route/path has a unique ID number (assigned by our engineering deparment) that must be included in a separate ID ...
0
votes
1answer
62 views

How to assign a new name for values selected from two columns?

I'd like to assign a new name (either HIGH, MEDIUM or LOW) to values selected from different columns in ArcMap 10.3 I selected the two values from the two columns ("MAIN_ROCK" and "SUB_ROCKS") using ...
1
vote
1answer
48 views

How to select different values from two columns through Select By Attributes?

I'm using ArcMap 10.3. I'm trying to select by attributes different values from two columns. I want to define the areas where Main rock is GRAVEL And Sub-rocks are : a. mudstone tephra loess b- ...
1
vote
0answers
68 views

How to create a sequential unique id by groups?

I'd like to use the field calculator in QGIS to create a unique feature (polygon) id that reflects different levels in a geographic hierarchy. So say I have a REGION attribute within which there are ...
1
vote
1answer
49 views

Calculate proportions of point counts per polygon based on threshold values

I have an attribute table containing "Joint_Count" and Raster ID (A1, A2, etc), where Join_Count refers to the sum of points per raster ID. If the sum of all Join_Count represents 100%, how do I ...
0
votes
0answers
24 views

Using ArcGIS field calculator to rank continuous field within shapefile using VBscript parser? [duplicate]

So have been trying to get the VBscript code below to work in the ArcGIS field calculator. The values are a continuous set of data between 15-88, and I have used the natural breaks jenks rank to rank ...
1
vote
2answers
96 views

Syntax error in parameter formula of field calculator funtion

I'm using a QGIS 2.8.1 in windows. Have some doubts with syntax when use string in python console. I want to use the field calculator funtion like: processing.runalg('qgis:fieldcalculator', input, ...
3
votes
2answers
179 views

Calculate QUARTER from Date field using ArcGIS Field Calculator?

I currently have a Date field in the format of MM/DD/YYYY. My goal here is to convert the Dates into 1 of 4 quarters, along with the Year. The field to be created will be called QTR_YR. My first ...
1
vote
1answer
44 views

Calculating field on insert (real time) using QGIS?

We use QGIS as a field application. We like to calculate with a input value and then also calculate with the result of the calculation Example: Liters: 1000 -> Liter per container: "this has to be ...
1
vote
1answer
113 views

Calculating XY in Model Builder using Calculate field

I'm trying to calculate the lat/long of a feature class in GCS NAD83. The picture shows what goes below. I can get it to work for distances and areas, but not a centroid. What looks incorrect?
5
votes
2answers
562 views

Way to find minimum value from a group of values - QGIS?

I'm wondering if there is a way to find the minimum value of a group within QGIS? Basically I need to find the minimum distance of each unique value in a table of about 5000 records. I can do the ...
1
vote
1answer
72 views

Debugging Indentation error on Python Parser of ArcGIS Field Calculator?

Would anyone please help me find out why I get an indentation error in line 3 def calc(f1,f2,f3): remove_list = ['01ST', '02ND', '03RD', '04TH', '05TH', '06TH', '07TH', '08TH', '09TH'] if f2 in ...
2
votes
1answer
67 views

Python codeblock to remove numeric characters from a column not working

I am trying to make use of a codeblock found in this thread: How to remove numeric characters from alphanumeric value in field calculation? I put this code into the pre-logic script field of the ...
1
vote
2answers
873 views

If/else statement in arcgis

I try to fill the fields with the condition if / else but it does not work. I do not know where is my mistake in the code. def TextValue ( !Classe! ): if !Classe! == "Steppe arbustive" or !Classe! ...
2
votes
2answers
92 views

type mismatch: 'esri_8' when using field calculator

I am trying to run the VBScript 'round' function using the field calculator on a column for a numeric field that contains a large number of rows (> 500k). When I run the code on a subset of the field ...
0
votes
1answer
95 views

Using Python for Field calculator?

I have problem with Field Calculator, using ArcGIS 10.2. I tried to write a statement but I don't know what is wrong. I have two columns: The first contains a number code. Every code represents ...
2
votes
2answers
85 views

Calculate Field using Fieldnames(variables?!)

the Question I have is kind of asked before. But I couldn't figure out the solution. ArcGIS 10.2.2 Python 2.7.5 I`m adding fields to a table using user input for the fieldnames. Then I populate ...
3
votes
1answer
114 views

Reclassifying a polygon using ArcGIS field calculator?

I am trying to reclassify a polygon into three classes: 1 and 2 = 5 3 and 4 = 3 5 = 1 I have been trying to do this by calculating a new field in the attribute table but I am very ...
2
votes
1answer
224 views

Copy first row of attributes and paste for each feature

In a newly digitised polyline vector layer, there are 7 columns attributes value that are choosen inside a value map combo-box that MUST be exactly the same for every newly digitised line (I choose ...
0
votes
1answer
201 views

Changing Date Format via Field Calculator of ArcMap?

I'm trying to find a function in the Field Calculator (preferably in VB Script) that can add numbers into a field that already has data. I have year data ranging from the 1960s to 2014 in string ...
0
votes
0answers
39 views

Linking Statistics Type with Calculate Field after Table Join using ModelBuilder?

I am attempting to build a model using ModelBuilder in which there is a zone statistics tool being run iteratively for a set of rasters. The input is a blank template table that contains the number ...
1
vote
1answer
111 views

Adding a sequential number using ArcGIS field calculator to string file and keeping the 0 in front of the number? [duplicate]

I want to know if anyone has a code to count +1 starting at a certain number for Field Calc. ArcGIS. (I.e. 04312, 04313) It also must keep the 0 in front. rec=0 def autoIncrement(): global rec ...
4
votes
2answers
224 views

Script (ArcPy) vs field calculator (Python Parser) behaviour of getPart in ArcGIS for Desktop?

From time to time I have to access geometry field and shuffle through points in it. Process is simple: Get shape Get it's part Iterate through part's points This is how it looks like in a script ...
0
votes
1answer
101 views

Using Field Calculator with Python Parser and if/elif statements in ArcGIS for Desktop? [duplicate]

I have tried all of below snippets to use Python Parser in Field Calculator and update the values of a field called type based on a filed called MamerMN but in all of them I am getting Syntax error in ...
1
vote
2answers
190 views

IF THEN statements in ArcGIS Field Calculator

I'm not sure if this would be best handled in vbscript or python, and unfortunately I'm less than novice at both so I'll take any help I can get from the exchange. I'm trying to take my streets layer ...
0
votes
1answer
51 views

CalculateField_management: Different results than in the field calculator

I`m using ArcMap 10.2.2 and Python 2.7.5 I´m tryig to calculate values with the CalculateField_management tool. my script: def mthree(mthre, mtwo): if mthre >= 1: return -3 if ...
0
votes
0answers
42 views

Added Field not showing in calculate field tool in modelbuilder

I am attempting to create a model that adds a field of the same name to multiple output feature classes, then calculates unique values for this field for each feature class. See the model below: ...