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
1answer
352 views

Python Field Calculation [duplicate]

Possible Duplicate: Iterative position within Field Calculator/Python I need to calculate a field for a data set that is grouped by county. At each change in county I need the column to ...
2
votes
1answer
201 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 ...
1
vote
1answer
231 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" ...
4
votes
1answer
593 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 ...
4
votes
3answers
3k views

split string after first word

I want to split a string field after the first word using the space as a delimiter so that "WA ROSSOUW ORANJE BELEGGINGS" becomes "ROSSOUW ORANJE BELEGGINGS". I am using Arcmap10. Thanks.
2
votes
4answers
3k views

Basic Field Calculator help

I have no experience with Field Calculator in ArcGIS 10. I have a very simple calculation I would like to perform that I could do easily via pure SQL but just can't seem to get my head around it in ...
1
vote
1answer
1k views

Do QGIS Field Calculator xat(n) and yat(n) functions work in version 1.7.x?

I'm trying to use the xat(n) and yat(n) in the Field Calculator but can't get them to work. Does anybody have an example how to use them? I need the start and end coordinates for line segments, does ...
3
votes
2answers
5k views

Using conditional statements in Field Calculator

I have two fields, "P_Area" and "PC_Area", whose sizes I'd like to compare in a third field, "Areas_Equal". The "Areas_Equal" field should contain a "Yes" if the other two are equal and a "No" if they ...
5
votes
3answers
4k views

ArcGIS 10 Python split string

I am trying to use Python to split a string field into three new fields at the separator " - ". The field is in the format "a - b - c". So I initially had this in the field calculator for newFieldA: ...
0
votes
1answer
653 views

Null output from field calculator code block

I have a simple calculation to compare two columns and populate a new column with the lower value but I am getting null output...any ideas? expression ...
3
votes
3answers
7k views

Simple field calculator equation in ArcGIS 10 not working

I'm new to ArcGIS 10 and am trying to do a really simple field calculator equation and it is not working. I'm just trying to find the percentage of a certain demographic trait by doing: ...
4
votes
2answers
621 views

Why does field calculator expression sometimes return a binary value (0 or 1)?

I am running simple field calculator expressions and experiencing some of the silliest results I have ever seen. I am working on census data (living as a shape file) and trying to perform a simple ...
4
votes
2answers
1k views

arcpy: check for same record in cell above and below

After using the find duplicates in arcmap 10, I want to check if the feat sequence ("find duplicates" marks all records with the same attributes with the same number [in "feat_seq"] and creates a ...
7
votes
4answers
3k views

How to remove numeric characters from alphanumeric value in field calculation?

I have a field containing alphanumeric values in the following format: A-AA00 Sometimes they are also A-AAA0 I need a Python script I can put in the field calculator in ArcMap 10 that will at ...
8
votes
3answers
3k views

How to round a column in attribute table (ArcMap)

I want to use the Field Calculator in ArcMap to round an existing column to two decimals. Currently I have a column that is 6 decimal places long and would like to simply round it down to 2 decimals. ...
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 ...
6
votes
4answers
5k views

Field Calculation - Python - If/Then over multiple data columns

I have some VB code saved that looks at two columns of data, and populates a third with the low value. Pre-logic Script Code: Dim output as double if [MIN_LEFT] < [MIN_RIGHT] Then output = ...
2
votes
1answer
604 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 ...
6
votes
1answer
1k views

Get shape filename in attribute field using field calculator

I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
4
votes
3answers
457 views

Moving “last name” from last to first in the Attribute Table

How do you get e.g. "John D. Doe" to "Doe, John D." in the AT using VB Scripting without going individually going through each line? I am using ArcGIS 9.3. I should note that not all the names are ...
6
votes
2answers
3k views

Converting from DMS to DD using Python in Field Calculator?

I need to convert lat/long that is expressed as degrees, minutes, and seconds in the data into decimal degrees. For example, in the data, they are listed as N335042.06 in the Latitude column, and ...
3
votes
1answer
2k views

How to count and record the number of entities with the same name in the field calculator?

I have a question with ArcGIS 9.2. In an attribute table the column [name] includes the name of every place in this layer. Next to that (in columns [numbers]) there should be recorded how often a ...
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 ...
4
votes
1answer
1k views

How to convert state name abbreviations to full names?

I have a data table with columns that includes city names (ex: San Jose) and state name abbreviations (ex: CA). Is there a way to define the state names as their full names (i.e., CA = California) and ...
3
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? ...
3
votes
2answers
1k views

Force the decimals to use the comma in Field Calcuator ArcGIS 9.3.1

Can I add the comma "," to force the decimals to remove from the attribue and replace with the number? For example, I have an Acres field column that says 506320.0750 and I want to replace the decimal ...
4
votes
2answers
2k views

VBA functions use in ArcGIS Field Calculator

Would this be ok to use them for the field calculator in ArcGIS 9.3 ? See here MS Excel VBA Functions Or should I fix them in MS Excel and save as a file and then use the join with the shapefile or ...
4
votes
1answer
2k views

How do I add a hyphen to the Field Calculator to merge 2 columns?

I am trying to build a field calculator expression to merge two columns into one. I am looking for the word that makes it a range. Example: I have 2 columns in elevation, From and To. I want to ...
4
votes
5answers
1k views

Is there a Log or Ln function in QGIS Field Calculator?

I can't seem to find any way to take the logarithm (natural or base 10) of a field in QGIS. I have gotten to the field calculator but there is not a button for log and I can't seem find any formula ...
2
votes
1answer
357 views

Why does this python function return a value of 0 in field calculator?

I am trying to calculate the percentage of a total which the median value makes. I have a column with the median column labelled (i.e. 1st,2nd,3rd,4th column is median), the columns of values and the ...
4
votes
1answer
1k views

Qualifying field names in field calculator

I am trying to set up a quick model that: Takes a point feature layer of development projets (a table in an access database with xy coordinates), Spatially joins polygon neighborhood designations to ...
6
votes
4answers
8k views

How do you test for a NULL string field in the Field Calculator with Python?

I am trying to perform an operation on a string field with a condition that it contains data. Referencing None with Python does not appear to work when the field is nullable and contains <Null> ...
5
votes
5answers
3k views

How can one execute an SQL script in field calculator in ArcGIS 10?

I am trying to transfer over row data from a table to columns in a shapefile table. There is a common "SA" variable between the two (i.e. the study area number) but there is more than one land use ...
7
votes
2answers
2k views

How to calculate perimeter of polygons in Quantum GIS?

Is there a way to calculate perimeter of polygons with the field calculator of qgis, like there is for area calculation?
1
vote
1answer
341 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 ...
4
votes
3answers
4k views

ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script

I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...
5
votes
2answers
2k views

Arc 10 field calculator scripts

I need scripts for the field calculator that: extracts the first word from a column, i.e. "Jones School" - "Jones", and A script that will capitalize this new field, "Jones" - "JONES". This is Arc ...
8
votes
3answers
2k views

Is there a way to concatenate fields in field calculator of QGIS?

Is there a way to concatenate fields in field calculator of QGIS? (e.g. hectares + ' ha')
6
votes
1answer
861 views

Editing tables using SQL in ArcMap

We've recently started working with ArcMap, having used MapInfo previously. I've created a shapefile in ArcCatalog and want to update some columns using SQL. In MapInfo I'd write the following command ...
1
vote
3answers
505 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 ...
6
votes
2answers
3k views

Using Field Calculator in QGIS to update columns with centroid coordinates

In QGIS I would like to update two columns with the centroid easting and northing of my polygons. I am using the field calculator. I have tried using $x and $y but this only seems to work for points. ...
2
votes
3answers
793 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
2k views

How to populate a field with the max M value of a feature using Python in Field Calculator?

I need to calculate the max M value for a line feature using Python in ArcGIS 10 Field Calculator but I cannot figure it out. In 9.3 I used the follow VBA expression… **Pre-Logic VBA Script Code:** ...
6
votes
1answer
2k views

ArcMap Field Calculator syntax (again)

I'm trying to string together a field calculator script that will populate all the records of a field at once based upon values in a number of fields. I can't even get the first part of the command ...
5
votes
1answer
2k views

Python Field Calculator ArcGIS 10 expression for a RANGE

what is the python expression for defining a range of numbers? I have tried numerous combinations but cannot get a simple range of angles (100 -200) to compute correctly. Screen shot : screen shot ...
4
votes
1answer
3k views

Find and Replace expression needed in Field Calculator ArcGIS 10

Looking for the Field Calculator code (Python preferred) to replace the last numeral values in a field using another field's values for entire attribute table. Please see screen shot here:
2
votes
1answer
2k views

How to set the value of a field in all selected rows of a table using ArcGIS 10

I have an attribute table in ArcGIS (it's large - around 300,000 elements). I've selected some rows of the table using 'Select by attributes' and I want to set the value of a field for all of those ...
7
votes
2answers
4k views

Basic Field Calculator Python Question

I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why. I'm trying to create a ...
4
votes
2answers
5k views

If/then VBScript/Python code equivalent to SQL IN ('x','y',z') expression in ArcGIS Field Calculator?

we need just like the following, only with multiple records selected... have tried the "xyz" in (1,2,3,4,5) SQL code but of course VB Script wants something else. dim f2 if [field1] = "foo" then f2 ...
5
votes
0answers
207 views

How to set order of operations for Field Calculation in Network Analyst Evaluator Dialogue? [closed]

I desire to have a ratio calculated each time I create a new route. To get this ratio, I created and populated a field that multiplied the length of each segment by a designated number from 1-5, ...