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)

1
vote
0answers
67 views

Replacing Null values with field calculator

My goal is to use the field calculator to replace null values. I am trying to replace nulls in the ToDate_Time with the FmDate_Time. When I run the code below the results window says that it worked ...
2
votes
3answers
305 views

How to get around “The field is not nullable” error?

I have a shapefile of lines. I want the angle of every line calculated in a field. I am using the script below in arcmap, but when it encounters a line that is horizontal, it stops calculating any ...
2
votes
1answer
47 views

Loading Features prompt in QGIS?

I'm currently working on a dataset with 3.8m records. I have a very simple expression to update a field that I want to execute using the Field Calculator, while having the Attribute Table open. Do I ...
2
votes
2answers
113 views

Formatting SQL expression for calculate field (management) tool?

I am trying to take the population census tract and calculate the percentage of population by each census tract in the field (Populati_2). To do this I'm creating a new field with the total sum of the ...
1
vote
3answers
276 views

Using Field Calculator to compare two fields in att table and returning if equal or not in ArcGIS for Desktop?

Using 10.2.2 I am attempting to compare two fields in an attribute table using the Field Calculator. I'd like to return a value of '0' if they are equal and a value of '1' if they are not equal. ...
0
votes
1answer
81 views

Calculate percentages with field calculator in arcgis?

I am trying to calculate the percentage of each the area of each polygon in the selected area. I tried using ( math.fsum(!shape.area!) / !PolygonArea! )*100 and other codes but I cannot make it work. ...
0
votes
2answers
35 views

update cursor based on location

I'm working on a python script for ArcGIS 10.2/10.3. What I want is to automatically fill in a field of a point layer based on the location of that point in relation to a polygon layer. Say I have a ...
1
vote
2answers
158 views

Update multiple fields/columns in QGIS

I need to update fields in attribute table of a vector using QGIS. I use field calculator for each field, but i have too many fields (and too many vectors also) and i need to program the task. The ...
1
vote
0answers
11 views

How to calculate area percentage from polygons from one shapefile within another? [duplicate]

I'm working on a project where I have to create python code that takes land-use data and adds a percentage field for each land-use category in a Census Tract shapefile. I've been trying to work with ...
0
votes
1answer
46 views

Creating IDs for multiple features in Python Parser of ArcGIS Field Calculator?

Does anyone know how to create ID numbers for multiple features using python? For example; (IDs being the object ID, Name and object ID being two different fields) Names //// IDs Street 01 River ...
1
vote
1answer
25 views

Clearing Calculate Value before Model Run in ArcGIS ModelBuilder?

I am using ArcGIS 10.2 for Desktop. I have a model which contains several branches, which branch should run is based on the results of an earlier stage in the model. If the first stage of the model ...
2
votes
1answer
131 views

Populating attribute table string field with values from long field using vbScript in ArcGIS Field Calculator?

I want to calculate the field "area_type" with text depending on numbers from the "Value" field. I have tried with the following VB-script in "Field Calculator" but am getting this error message: "...
1
vote
2answers
87 views

Using nested If statement in Python parser of ArcGIS Field Calculator?

I'm trying to use field calculator to assign values to a new field I created. I wan't to assign the value from the first field unless that field is empty, if it is empty use field 2, if that is empty ...
1
vote
1answer
38 views

QGIS field-calculator: set attributes to 1 if country name is in a list of values

In a country table, I create a region field, ECOWAS, with 1 if the country belongs to the regions 'ECOWAS', 0 else. Country names are in the field "sovereignt". How can I build a field-calculator ...
0
votes
2answers
59 views

Iterating field calculations in arcpy

I was successful in adding multiple fields but had trouble running multiple field calculations in a loop. Now what I want is loop through these existing fields listed in mult_fields variable and fill ...
1
vote
1answer
47 views

Field calculations and existing domains

I have feature layer which needs to be updated with new attribute information. The text field I need to populate already has an established coded domain. I need to update hundreds of records and don't ...
0
votes
3answers
115 views

Python code help for ArcGIS Field Calculator tool (Model Builder)

Is there any python code that: 1st, sort a column (example name by alphabet) 2nd, grab the first cell of sorted column and assigned it to a variable like A=.. I need all of this to be done in field ...
1
vote
2answers
129 views

Replicating Summary Statistics tool with case field using own calculation within ModelBuilder?

I thought this would be a simple problem to solve, by my googling hasn't provided the answers so far. I have created a near table (Using the 'Generate Near Table' in Arc) comparing two sets of points,...
2
votes
2answers
61 views

Sequential attribute field calculations with null values using Arcpy

I have a series of x,y co-ordinates converted from a .ply file. I was able to extract the file into a suitable x,y format for arcmap, the issue I have is that they are co-ordinate points representing ...
1
vote
0answers
72 views

Converting UTM to Lat Long inside a Game Engine(Untiy 3d)

This is my first post on Stack Exchange. I have exhausted my research through the game engine forums, so I am trying this forum since you guys seem to be the experts. I have an external device that ...
1
vote
1answer
57 views

How do I round the coordinates of a point before insert into attribute table in ArcGIS?

Until now I doing the following steps to get rounded coordinates: create a new x and y column in the attribute table use Calculate Geometry round the column value with the Field Calculator using VBS ...
2
votes
1answer
106 views

Running ArcGIS field calculation using Python with algebraic expression using other field values as variables?

I'm trying to run a field calculation using multiple fields in a table as well as independent numeric values with python code in the field calculator window. I've included the first 7 lines of the ...
0
votes
1answer
70 views

What expression needed for universal naming of parts polygon feature class?

For example, i have n count of polygons and little parts of it. I want in field [Name] get string: "PNum1(1)". where "1" - number of main polygon [Num], "(1)" - number of part of main polygon [...
3
votes
2answers
395 views

Extract string between special characters - and / into a new field ArcGIS Field Calculator

Can I create a field calc expression in ArcGIS 10.3 to print a selection between special characters? I would like to extract a selection of string from field [FolderPath] to a new field [Name]. The ...
1
vote
1answer
46 views

Referencing external CSV file within ArcMap field calculator using python codeblock?

I would like to know if there is a way to incorporate an external csv file into a custom made python script in ArcMap field calculator. I am inputting fields from the current layer, but need to access ...
-1
votes
1answer
73 views

Adding Rasters with multiple Field Values using Map Algebra in ArcGIS for Desktop? [duplicate]

Embarrassed that I haven't looked at this for some time (can't quite get the syntax down). (ArcGIS 10.2, Win7x64). Within Map Algebra (Raster Calculator) Trying to add the cell values of 3 rasters, ...
3
votes
1answer
47 views

Help with Rastercalculator - Filter areas with a certain height difference

I'm struggeling a little bit with the rastercalculator tool of QGIS. At the moment I am working with a DSM and a DTM. My aim is to filter all wind turbines out of the DSM and replace it with the ...
2
votes
4answers
98 views

IF else statements arcmap, using python

I have a shapefile with a number of fields. I have one field (let's call it Field A) that I need to populate based on another field (let's call it Field B). If Field B is greater then 0 I need it ...
1
vote
1answer
88 views

Spatial join multiple attributes from smaller polygons to the bigger one

I'm trying to join (to the rectangle) values from multiple polygons intersecting for this rectangle. I've tried to use some Reference functions in Field Calculator like geomintersects() but it joins ...
1
vote
1answer
277 views

How to convert text to proper case using the field calculator?

I am working on a set of data that has over 40,000 records on ArcGIS and I want to use a Proper Case for several fields/columns on the table. Is there a Python or Java Script that can help me automate ...
2
votes
3answers
172 views

How to calculate Statistics of an attribute field to use it in another calculation

I want the statistics of an attribute field to use in another calculation, i can view the statistics using the field properties menu I want these to normalised the data of field 'Ia' using the ...
1
vote
1answer
32 views

Summarize multiple columns in field calculator [closed]

I am performing the Huff model with 10.000+ facilities and dwellings. As a result, each facility has a value between 0 and 1 that determines the probability a consumer patronages a facility from a ...
1
vote
1answer
74 views

Copying some values from several columns to another column in attribute table? [closed]

I am trying to copy selected values from several columns to one single column in the attribute table. Specifically, where columns (Grid_code, grid_code1, grid_code2.... etc) have values of 4 and 10, ...
0
votes
0answers
11 views

Replacing null values in cell with integer using Python parser of ArcGIS Calculate Field tool? [duplicate]

In one field I have certain cells that are filled with null values. I am trying to change all those null values to 0 or say even as random as 100. I tried with the Calculate Field tool the following ...
1
vote
1answer
51 views

Capitalizing The First Letter Of Each Word In Attribute Field QGIS

I have tried capitalizing the first letter of each string in my field/column called "COMMUNITY" by referencing this post: Capitalizing The First Letter Of Each Word In Attribute Field Particularly: ...
3
votes
1answer
48 views

How to convert a “yyyy/mm” field to “yyyy/mm/dd”?

I am trying to edit an existing date field of the form "yyyy/mm" to a format that the TimeManager Plugin for QGIS can handle - I guess "yyyy/mm/dd" will do it. I've got as far as opening the ...
2
votes
1answer
79 views

Reproducing GRASS GIS network analysis tutorial in QGIS Field Calculator

Im looking to reproduce the assigning of road speeds as denoted in a GRASS GIS tutorial (v.net.alloc tutorial), where the road speed is assigned by road type (i.e. 'interstate' = 75 mph etc.) to then ...
3
votes
2answers
127 views

Arcmap field calculator python script returns no data

I am running ArcMap 10.2 I have 4 fields with which I am working. many have duplicate entries. in order to find the single correct entry from all the duplicates I am trying to calculate out the ...
2
votes
2answers
164 views

QGIS 2.12 attribute table update question

I'm trying to fill in a whole lot of cells in the same column of an attribute table all at once using the field calculator. Am I on the right track with the following expression? "Author" || example ...
1
vote
1answer
535 views

How to copy same values to another field in attribute table in QGIS using field calculator?

I am trying to copy values from Parsel_ID to Parsel_NO using an equation ( look at pictures) in field calculator but it is not working. What is the problem and how can I success this task??enter image ...
4
votes
3answers
232 views

Using IF operator with Python parser of ArcGIS Field Calculator?

I want to assign numbers to a certain types of building and I need to use field calculator. I tried many different versions of this and I still cant find whats wrong. Could you tell me where do I ...
0
votes
1answer
215 views

Use Get Field Value tool to calculate field?

I am running a summary statistic on a clip to get acre counts by area type. I want to then add a second field that has the acre count from the total area. A third field be added so that it shows as ...
1
vote
0answers
52 views

Using timestamp field to auto complete source field in QGIS

I am trying to use my timestamp field to autocomplete my source field in QGIS using the field calculator. I want my source field to be completed with a saved string e.g "Sam_Sam". I want my source ...
7
votes
1answer
156 views

Filling fields with conditional clauses

I have four fields in my shapefile. I would like to fill only one of them (cell of attribute table) and automatically after to write one cell the others one will be filled by conditional clause. I ...
0
votes
1answer
81 views

Python if/then Statement in Field Calculator to return 0 or 1 based on numbers divisible by 28?

I don't use python all the time. In a point feature class, I'm trying to populate an ID field with 1's and 0's based on whether the FID is divisible by 28. I've started the following code but can'...
0
votes
2answers
88 views

Understanding if-else statements in ArcGIS field calculator when coded value domain used?

I am attempting to set a newly created field based on the strings in another field 'TNMFRC'. I am pretty sure that I have the code write, and yet everything is set to a value of '6'. Here's my code: ...
1
vote
1answer
185 views

Python script for if/elif condition in field calculator [duplicate]

I need some help in calculating the last column (OD_pairs.Ai_) based on the condition; if travel_cost has a value below 10, OD-pairs.Ai_ takes the value of the first column(Aij_OjFCij..) if ...
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
109 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 ...