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

2
votes
2answers
433 views

Type mismatch error in Calculate Field tool in ArcGIS 10.1

I'm trying to run a rather lengthy model (built in ArcGIS 9.3.1) in ArcGIS 10.1 and I'm recieving an error on a Calculate Field tool. The error is - Type mismatch: 'iif'. This error is refering to ...
2
votes
2answers
572 views

Trimming Specific Text Values in QGIS Field Calculator

Sorry if this is a dumb question, but I am wondering if there is a way to copy the text from one field to a new field, but eliminate specific words. For example: **Old Field** ...
2
votes
1answer
48 views

How to return end of string up to a certain character using Field Calculator?

I am trying to accomplish this task: http://stackoverflow.com/questions/15851568/how-to-get-the-last-part-of-a-string-before-a-certain-character within the Field Calculator. I have the below but ...
2
votes
2answers
155 views

Convert from Julian Date to Calender Date in Field Calculator

Does anyone know of a way to convert from a Julian date to a regular calender date in either QGIS or ArcGIS field calculator? Thanks...
2
votes
2answers
101 views

Conditional field calculator expression

I need to calculate the PIPEID field to equal the G_KEY_COMP field if PIPEID is null or PIPEID and G_KEY_COMP do not match. I think the first condition of the PIPEID being null is covered by the ...
2
votes
3answers
135 views

Calculate Field tool to calculate on null fields

I'm using ArcGIS 10.1. I want to use the calculate field tool in ModelBuilder on a table where if field1 is null, it should take the value of field2. If field1 has a value then it should stay as is. ...
2
votes
3answers
92 views

How to write FIDs of points within each polygon to polygon field?

I have two feature classes one with points one with polygons (in ArcGis 10.2). Now, I want to write into a String Field of the polygon layer a list of all the Point-FIDs that are within each polygon ...
2
votes
2answers
218 views

Capitalizing The First Letter Of Each Word In Attribute Field

Does anyone know of a way to capitalize the first letter of each word in a field in an attribute table? I am doing this in QGIS. I know of field calculations to change all the words to Lower or ...
2
votes
1answer
358 views

Am I over-complicating adding and then calculating fields? Suggestions for a better way? (Python)

I'm attempting to re-position a question I asked yesterday here. I am starting to think that the way I wrote my code just isn't the best way. Am I overcomplicating things? I know for a fact that ...
2
votes
1answer
2k views

ArcGIS 10.0 \ arcpy - CalculateField_management : help with syntax for updating text in attribute table of feature classes

I am trying to add (ie "Author", "LastUpdated") to feature classes within a gdb and then populate each of those fields. I have been able to get my code to run properly for the numerical field but I ...
2
votes
1answer
454 views

Field Calculate Degree Minute Second in Different Format

I have a field that is in degree minutes seconds, populated from ET Geowizards COGO Inverse tool. It populates the values as 90-12-28.15 where 90 is the degree, 12 is the minutes and 28.15 is the ...
2
votes
1answer
440 views

Field Calculator operation is not working

I've done this 100s of times and I can't understand why it won't work! I'm trying to copy the first 8 digits of from a HUC 12 (Hydrologic Unit Code) to a new field, which represents a larger ...
2
votes
1answer
549 views

Iterative position within Field Calculator/Python

I'm not great with Python or programming in general, so I'm not even sure how to ask this question. Basically what I've got is in the left column, and what I want is in the right column. UniqueID ...
2
votes
1answer
1k views

Summing Attributes from a Related Table?

I have a line feature class representing road segments, with each road segment having a unique ID. This feature class has an attribute of average observed daily traffic counts. I have another table ...
2
votes
1answer
584 views

Does QGIS support parsing of date strings in tables?

It is straightforward to load GPX files (GPS downloaded tracks / points) into QGIS, then save and manipulate them as shapefiles. However, the recording date (in the comment (cmt) field) of waypoints ...
2
votes
1answer
40 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
198 views

How to compare string fields in the same table with ArcGIS 10

I don't know exactly if there is a tool for this or a maybe a python script could be more suitable. I want to compare string elements from a field (POI_NAME) with another string element in another ...
2
votes
1answer
93 views

Replace characters

How to remove a special number of characters of a string, e.g. the last 7 characters? And how to join them as the first characters to the string of another field? Thank you for VBS and Python synthax ...
2
votes
1answer
68 views

Decimal Degree data erases itself between edit sessions in QGIS

I have a shapefile with point data. I calculate the $x and $y of the points successfully I save the changes and close the edit session. Once I reopen the attribute table, the data after the decimal ...
2
votes
2answers
80 views

python add fields that may have NULL values

I would like to use python to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have NULL values for one or more of the fields. ...
2
votes
1answer
59 views

Arcpy Calculate Field Formatting Syntax

I am trying to field calculate a double field (PID) to a new string field (PIN). Using: qry = '"139-{}".format(!PID!)' arcpy.CalculateField_management(out, "PIN", qry, "PYTHON") Given a PID = ...
2
votes
1answer
192 views

How to copy values from field to another using arcpy?

Can some one please let me know how I can do simple field calculation like Copying From "A" to "B" in ArcPy? I have found lots os example on web which they all used extra expression and they were ...
2
votes
1answer
80 views

Populate an attribute table field using the 'startswith function

I am hoping that someone may be able to help me. I am new to ArcGIS, and even newer to Python. Working in ArcGIS 10.1, I have done is created a new text field in an attribute table, which I have ...
2
votes
1answer
354 views

Calculating a field based on two other fields, if they exist [duplicate]

I'm using ModelBuilder to iterate through ~800 shapefiles to add and calculate a new field (I'll call it Field_A). Field_A needs to be populated by either Field_B or Field_C, whichever exists. Half of ...
2
votes
2answers
910 views

Use Feature Class “Name” from Iterate Feature Classes to Calculate Field with Model Builder 10.1

My goal is to create shapefile that contains merged feature classes from a geodatabase. I would like for there to be a new field in the resulting shapefile that contains the name of the original ...
2
votes
1answer
155 views

Need a Python field calculation that works like the DatePart( ) VB Function

I have a field called Abandoned Year (short integer data type) that I am trying to populate with a four digit year from a column called Decommission Date (Date data type). I have done this in the ...
2
votes
1answer
106 views

Syntax question for ArcGIS ICalculator object

This is a silly question, but I have this code snippet that I can't figure out: 'Define a calculator for NewArea field pCalculator = New Calculator With pCalculator .Cursor = pCursor ...
2
votes
3answers
782 views

Field calculator script not working

I am trying to do the following in the field calculator in ArcGIS 10 if [IncdStDir] = " " then [IncdStNo] &" " & [IncdStName] &" " & [IncdStSfx] else [IncdStNo] &" " & ...
2
votes
1answer
42 views

Populate field with current time

I am trying to populate a field with the current time. Here is what I tried that did not work: Start editing Open Attribute Table Add Field -> Name: time Type: Date Right Click on Field Name ...
2
votes
1answer
51 views

Problem with Python codeblock recognizing a field

'<'First Post Alert> I've been through multiple iterations / gyrations, and while there may be multiple problems here (and I'll appreciate feedback on all of them), the recurring issue is that the ...
2
votes
1answer
50 views

How to find and replace a singe word in a string?

How do i find and replace a single word of a string? e.g. Calle Iparraguirre to Iparraguirre I've tried: replace( 'Calle\\s', 'Calle\\s', '') replace( "name",'calle','') and all combinations ...
2
votes
2answers
66 views

Call field from zip() into Field Calculator expression ArcGIS

I've been trying to find a way to call in field names from a zip(). Basically I have 12 fields called "Flw_days1", "Flw_days2" etc and corresponding "Depth" fields that need to be calculated using the ...
2
votes
2answers
310 views

How to use DateDiff() Function across day transition in ArcGIS Field Calculator?

I am trying to calculate the time difference between two fields using the DateDiff() function in minutes. I have successfully calculated the times that fall within the same day but I am having trouble ...
2
votes
2answers
131 views

Expression to calculate and sort data from several layers into one layer

I am trying to develop an expression whereby one layer can add data from 2 other layers and then rank them, is this possible? I have also tried the problem with using just 1 layer but I cannot work ...
2
votes
1answer
244 views

How to make autoIncrement number start with (001…009, 011…099)?

i have a challenge with my time in my work, i have feature class called "Parcel" storing many data, i generated an autoIncrement number by using field calculator, in field "parcel code" Expression: ...
2
votes
1answer
184 views

How to assign values to field using if/then logic involving multiple fields?

I want to run a field calculation on a string field named [territory] that first looks at a string field [majr_src] to see if there is a value other than "NONE", if so [territory] = [majr_src]. If ...
2
votes
2answers
163 views

Correctly calculating attribute table column in gvSIG

I am trying to conduct a multicriteria evaluation, and it is necessary to check the compatibility of two different land-use types that I have in seperate layers. I am working in gvSIG 1.12, and have a ...
2
votes
3answers
608 views

Python script for identifying duplicate records (follow up)

I am trying to calculate a field that marks duplicates and sequentially numbers them. I am using the code below that I found here: Generating sequential numbering for duplicate values in a field ...
2
votes
1answer
146 views

Using Sum() or something similar with CalculateField_management and FieldLists

I need some help with using variables with CalculateField_management tool. I've tried several different scenarios but don't seem to have any luck. What I have is a list of fields containing water ...
2
votes
1answer
155 views

Using update cursor on a field with a domain

I have been replacing field calculations with python update cursors in many of my work flows and today I ran into a problem. The fields being updated have an attribute domain. so now, when I ...
2
votes
2answers
1k views

Using Value from Iterate Feature Selection to Calculate Field in ArcMap 10.1 ModelBuilder

I have two polygon feature classes, an alignment layer and a parcels layer. I am trying to use ModelBuilder to create a tool that will do the follow: iterate through groups in a single field of a ...
2
votes
1answer
58 views

using “abs()” function in QGIS field calculator?

I'm pretty new to GIS in general and I'm trying to take an absolute value of the difference between two fields in field calculator when creating a new field, but using ABS () returns an invalid ...
2
votes
1answer
92 views

How to convert QGIS Field Calculation to ArcGIS?

I have a field calculator expression I use in QGIS to generate unique IDs that are sequential, but start with a text string. I now need to perform the same thing in ArcGIS, but I am unsure of how to ...
2
votes
1answer
796 views

Incorrect field name resulted in RuntimeError: ERROR 999999 (Also, better code for adding and calculating fields)

This is the bottom half of my code (and it's been edited somewhat to share publicly). The code works perfectly fine when the fieldList has only three fields in it, but when I populate it with all 108 ...
2
votes
1answer
912 views

Using the Field Calculator in a Domain field

I have a coded domain field with 10 dropdown options. Possible choices include integers and text. I need to change a selection of 250 features (which have differing values) to the same value. This ...
2
votes
1answer
203 views

Mysterious Invalid Syntax in Field Calculation

I'm trying to calculate a field in Model Builder using the Calculate Field tool. I'm using the following code block and expression in the calculation, but am getting an "invalid syntax (, line 1)" ...
2
votes
1answer
569 views

Using Python in the Field Calculator, how do I refer to a field in another shapefile?

I want to compare the changes in geometry between two shapefiles (of election districts in NYC. One is from 2001 and the other 2005). I am attempting to calculate a new field in the 2005 shapefile ...
2
votes
1answer
1k views

QGIS field-calculator replace function

I've got a Shapefile containing contourlines which I would like to style differently according to their value. For that reason I created a field named "100s" where I would like to give values from ...
2
votes
1answer
248 views

How to implent a “maketrans” python function on field calculator

i'm traying to implent python string translate function at field calculatore http://www.tutorialspoint.com/python/string_translate.htm in order to fix hebrew imported from cad. here is the code - def ...
2
votes
1answer
194 views

Why isn't this Python calculation working correctly?

I want to label the source files for a unified shapefile, and there are three respective columns for each. If there is no value in the column, there is no data from that source; if there is a value in ...