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
1answer
401 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 ...
2
votes
2answers
65 views

What's the use of the buffer function in field calculator?

I'm trying to find out how the buffer command in the filed calculator works. I tried to create a new field to my point shapefile (integer) with the following: buffer ($geometry, 100) but no ...
2
votes
0answers
48 views

Using Field Calculator to Convert Data Type In Field

I am trying to convert a field that is listed as "String" because it was imported into QGIS as a CSV (rural poverty population percentages by county in NC). I need to convert the percentages field ...
2
votes
2answers
130 views

How to trim strings in Field Calculator?

I am currently working on a County plat book and am in the process of prepping the "Owner_Nm" field that will serve as my annotation layer. I am trying to whittle down the owner names, based on ...
2
votes
0answers
28 views

How to save complex expressions in QGIS Field Calculator? [duplicate]

I have been debugging some long case expressions in the field calculator and getting frustrated because I have to remember to copy the expression before I test it otherwise I end up having to reenter ...
2
votes
1answer
405 views

Field Calculator Runs In IDLE (2.6.5) but not ArcGIS 10 SP3

just wondering if anyone else is having issues with the field calculator in ArcGIS 10 SP3. In the following code I do a pretty simple field calculation with a variable (an array) as one of the ...
2
votes
2answers
225 views

Can anyone tell me why my field calculator is returning this error?

All I am trying to do is pull into a text field, a section of another text field via: fieldB = !fieldA![some_index:other_index] However I keep receiving the error below and I can't figure out why. ...
1
vote
2answers
68 views

How can I do more flexible matching in conditional expressions than provided by LIKE?

With LIKE '%' works but I have had no luck with character ranges, i.e. [0-9] to match a digit. Oh for a regular expression ;)
1
vote
4answers
917 views

Field Calculator: Add “0” to the front of all values in a column

I have a table for each state with Zip Code values. The 5-digit Zip Codes that start with "0" have been reduced to 4-digits. I cannot figure out how to add a "0" to the front of all the values in the ...
1
vote
1answer
811 views

Delete first two letters from a string field

I'm looking for a field calculator python statement to delete only the first two letters of string entries. For Ex: !Name!.strip([0:2]) I know this syntax is incorrect. Thanks a lot
1
vote
3answers
1k views

field calculator syntax error

I'm trying to calculate the direction the 'generate near table' function gives me into actual directions, N, NW etc. Azimuth would be a start too. I tried this script in the field calculator but it ...
1
vote
2answers
130 views

How to populate a text field with double quotes using field calculator

How would I populate a text field with double quotes using the Field Calculator. For example, I want to populate a field as 24". Is there a way to populate fields using the field calculator with ...
1
vote
3answers
363 views

How to Convert a Number to Percentage in Field Calculator

Using ArcGIS 10.2 and Personal geodatabase,I have a field with values of Numbers like 0.461538 and Type of "Double" can you please let me know how I can Export them to new Field in Percentage Format ...
1
vote
3answers
145 views

Conditional Statement for attribute data

I'm trying to write a conditional statement that references another field within the same shapefile layer. I want it to only do so if the one field is " Null " and leave is alone if there is already a ...
1
vote
2answers
112 views

How to get a string from a Double with a fixed number of decimals?

I have a featureclass (in a File Geodatabase), with a particular field of type Double. I want to copy it over to a text field, so that only 3 decimal places are shown. For example: 34.78902345 ...
1
vote
3answers
489 views

python: Replace Variable in VB-Expression-File (.cal) [ArcGis 9.3]

I'm trying to modify a VB-Expression saved in a cal-file: dim out if [D19830701]=-9999 then out= [D19830501] else out= [D19830701] end if __esri_field_calculator_splitter__ out with this ...
1
vote
5answers
98 views

Calculations in if statement

I want to perform a simple calculation with the Field Calculator using this piece of script (note that all the elif statements are attempts for another syntax and non of the worked): def ...
1
vote
1answer
298 views

How to sum up multiple columns values into one single column

I have one table containing many columns. Using field calculator, I want to create a new column containing (for each line) the sum of all columns values. Pretty dumb, but just cannot find the correct ...
1
vote
2answers
117 views

Creating a new integer field based on text in a different field - ArcGIS 10.1

I need to create a new integer field based on another text field. All instances of a the same text string in the existing field should be assigned the same number (starting at number 1). Can I do this ...
1
vote
3answers
419 views

Why do area calculations return negative values?

I have created a shapefile with some polygons and am now trying to calculate the area of these polygons. The original CRS was WGS84, I have reprojected it to WGS 84 / World Mercator so unit is metres. ...
1
vote
1answer
103 views

How to write a expression in field calculator for finding $X and $Y?

I'm trying to calculate the lat/long of points using the Q GIS field calculator.Nathan W suggested to First, save the layer as WGS84 and import it again. Then in the field calculator you can use $x or ...
1
vote
2answers
273 views

How to write a QGIS regex for rounding to two places after the decimal point?

In QGIS field-calculator round() is not working in QGIS 1.8 so I try to do the following with a regex: I'd like to keep the first two places after the decimal point - where do I go wrong? ...
1
vote
2answers
349 views

ArcPy Field Calculation with special characters

I'm trying to calculate a string field, using "µSv/h". Running this in the manual field calculator works just fine, but I've tried this in the Python window in ArcMap as well as the IDLE, but both ...
1
vote
1answer
74 views

How to fill inn A, B, C …Y, Z, A, B, …Y, Z, A, B, and so on? [duplicate]

as a second part of a problem i am trying to solve. I need help to figure out how to fill in serial letters.. Starting at A.. going to Z and starting over at A again.. I have a tabel with numbers ...
1
vote
1answer
491 views

Arc 10 Python .shp attributes - usings fields to populate other fields - if/then/else statement

Ive been looking for a solution and unable to find one so please help if able: I'm trying to avoid manually inputting Begin and End engineering station values already inputted into a seperate field. ...
1
vote
1answer
141 views

How do you calculate values of a field based on two others using Field Calculator in ArcGIS 10.0?

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
3answers
448 views

Automatically assign numbers to point file in various order in QGIS

I know how to automatically assign numbers to a new point files using the $rownum function in the field calculator. However it does it from the top-left over and down like reading a book. I could ...
1
vote
2answers
67 views

How to include a quotation mark in a text field from field calculator

I'm trying to attribute pipe size and need to include a quotation mark in a text field. How do I include that in the field calculator. "4"" doesn't work.
1
vote
1answer
64 views

Python in ArcGIS, CalculateField_management, updating with single value

I have a float field which I want to simply update all values with 1. I can easily do this within the field calculator but I have started using python today, what is the syntax to simply update a ...
1
vote
2answers
76 views

Iterate through each county in a shapefile, select the county and make a second selection by location - modelbuilder

The goal of my project is to create a table with two fields. The first field showing a county name and the second field listing every county that touches the boarder of the county listed in the first ...
1
vote
1answer
50 views

Use field calculator in QGIS so get number of points in polygone and store it in attribute table

I have to layers, one point one polygon (with 6 areas) stored as shapefiles. Now I want to count the number of points in each area and write it into the attribute table of the polygons. A column ...
1
vote
2answers
477 views

How to fill attribute field of one feature based on calculation on attribute field of another feature

I would like to fill an Attribute field of a geodateabase table based on some calculations such as 'sum' over specific field of another Feature class. Is there an Approach to formulate it? while in ...
1
vote
1answer
177 views

How to concatenate XY values in attribute table without messing up the numbers in ArcGIS 10.1?

Here's the procedure I use and the resulting problem I'm having. First I use the Add XY coordinates tool to add POINT_X and POINT_Y fields to the attribute table of a point layer. I then add a new ...
1
vote
1answer
125 views

Stuck updating one field based on the condition of another using Acrpy or Field Calculator

I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with ...
1
vote
2answers
339 views

area values determined with field calculator become null when saving

using field calculator in Qgis 1.8.0 to get the area, it shows just right at first but when I save it, the values become Null. help please
1
vote
1answer
900 views

Concatenate Fields into One Field in QGIS

I have seen some posts on this, but only for ArcMap. I am looking to take a range of values from two fields and concatenate them into one field to make a unique value. For example: XMAX YMAX ...
1
vote
2answers
388 views

FieldPyculator Plugin - How to Classify Fields?

Could someone tell me how to classify/populate fields with QGIS FieldPyculator Plugin? In the Attribute Table, I have a field named POPULACAO with population data: I want to apply a weight to ...
1
vote
1answer
225 views

Small issue with field calculator

What am I doing wrong in this field calculator logic? Pre-logic def re_score(elev_t,f2, contour): f2=contour if elev_t.endswith('.5'): f2 = "Midi" return f2 Expression for field "Contourtyp" ...
1
vote
1answer
337 views

How to tranform a column field into a list using Field Calculator

I'm trying to make a simple field calculation with ArcGIS 9.3: New field = Old field - Old field(first value) which in Calculate Field with python code should be Expression: !Old field! - first ...
1
vote
2answers
58 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 ...
1
vote
1answer
61 views

How to use Fields in the Field Calculator? [duplicate]

I'm using the Field Calculator in ArcMap and I need to create a unique ID for every storm drain in my county. An ID Should look something like this: 16-I-003 The first number is the municipal number ...
1
vote
1answer
47 views

Arcgis 10 assign values to field based on values in other field [duplicate]

I have a table with two fields A and B, and i want fill field B with "some values" from field A: FieldA: 123456_CC; 123_D; 1234567_AB; 123456768_F I just need the "text" that is associated with the ...
1
vote
1answer
50 views

Create and immediately update field using Field Calculator

You can create fields and once created, populate them with data using the Field Calculator. But can you do both at the same time using an expression? Or must you do it in 2 steps?
1
vote
1answer
24 views

Does ArcGIS Desktop have conditional function useable in field calculations?

Does ArcGIS / ArcView 10 have a conditional function, e.g. ifx(test,if_T,if_F), that could be in-lined in field calculations?
1
vote
2answers
98 views

Calculate field based on most frequently occuring text/value in other fields in attribute table (ArcGIS)

I was wondering if anyone knows if it is possible to calculate a field based on the most frequently occurring value in other fields. What I have is 5 fields with crop information over 5 consecutive ...
1
vote
2answers
169 views

How to add a new column in attribute table with attribute with indexes of another max-min ordered attribute field?

I've an attribute column named e.g. VALUE with different values I would like to make a column named e.g. ORDERsuch that the greatest value has the attribute 1 the second value 2 etc. etc. so order ...
1
vote
1answer
156 views

Cursor Update Python Script for Multiplying Several Fields against a Ratio (Real) in ArcGis

Disclaimer: Python Neophyte, Uber-reliant on GUI, working to wean... I have a Python script for replacing multiple Field values with another table value that was graciously provided by the inimitable ...
1
vote
2answers
155 views

Using a different projection to calculate areas using the Field Calculator

I have a dataset that is in a WGS84_UTM projected coordinate system, can I force the Field Calculator to use another coordinate system when I use it to calculate areas using pythons ...
1
vote
1answer
143 views

Convert a number in attribute table to binary

I would like to convert whole integers from decimal to binary in ArcGIS using the field calculator. I am looking for the equivalent of DEC2BIN excel command. All values are 255 or below so 8 bit is ...
1
vote
2answers
158 views

Stop rounding values in Qgis attribute table

I am calculating the areas of my polygons in Qgis using $area and everything works fine until I click on "save". All my values are rounded to an integer. I tired setting the output field type to ...