Questions tagged [field-calculator]

Use for questions about Field Calculators of QGIS, ArcGIS Desktop, etc and their Calculate Field tools

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Calculating Field from text to integer using ArcMap [duplicate]

I'm using ArcGIS 10.7 trying to calculate a speed field (for my data of roads in California) really simply such that roads = 45 and highways = 65. I know I need to use an if then statement but I'm not ...
1
vote
2answers
51 views

Getting max value from field in Field Calculator of ArcMap

I'm working from a geodatabase in ArcMap 10.5, and using Model Builder. I currently have a field with values that range from 0 to 30 and I want to convert that to a 0-10 scale. The idea was to use a ...
4
votes
2answers
160 views

Switching road names from uppercase to mixed case in ArcMap?

Our county road data has road names for all roads in the county. In the attribute name field, there are some entries with all uppercase for the road name and some with mixed case. I would like to go ...
0
votes
0answers
45 views

Using Calculate Field in ArcGIS Pro

I have several field in an attribute table that have value, I am wanting to using the 'Calculate Field' GP tool to select the values and replace them with zero. Anyone have any ideas on the Python ...
5
votes
1answer
202 views

QGIS Field Calculator Expression - GeoHash32

I am attempting to write a QGIS 3.10 Field Calculator Expression that will use the mz2geohash library to encode the centroid of the current feature as LAT/LON, and then pass this tuple to the ...
1
vote
1answer
41 views

Making a spatial link to points within polygons in the field calculator in QGIS

I have a polygon shapefile of the counties in the UK and a separate point shapefile of project sites. Within the project sites attribute table I would like to add a new virtual column with the name ...
3
votes
1answer
75 views

Calculating the sum of a column based on another column in another table in the field calculator of QGIS

I have a records table with site numbers and abundances of different species at that site (e.g. site 1 has 6 common bats and 13 pipistrellus bats). I would like to sum total number (i.e. 6+13=19) at ...
6
votes
2answers
61 views

Assign values to points according to a pattern

I'm making a map of trees in QGIS (3.10). Each point represents a tree and the attribute table has a column that should contain the tree species. For now this column is empty, but I would like to fill ...
1
vote
1answer
59 views

Replacing Attribute Values With New Values Based on the Old Values Using ArcMap Field Calculator [closed]

I am using the Field Calculator of ArcMap. I need to replace multiple values (codes) with another words in a field at one time in one script. For example in my CodeField I need to replace "A01", "...
2
votes
1answer
59 views

QGIS 3 field calculator- hide name of one field (column/attribute)

My code: CASE WHEN length("Straße/Nr.")>0 THEN ( ( 'Name: '+ "Name" ) +'<br>'+ ( 'Straße: ' + "Straße/Nr." ) +'<br>'+ ('Religion: ' + "Religion" ) +'<br>'+ ( 'URL: '+ "URL" ) ...
2
votes
1answer
51 views

QGIS 3 field calculator

first: my screenshot What I want: the two fields here only with "Straße:" should be empty. The other four results are ok. What I have done is: CASE WHEN "Straße/Nr." IS NOT NULL THEN ('Straße: ' ...
1
vote
0answers
27 views

Calculating values for new field using values from another field as values in dictionary?

I am using the ArcMap application of ArcGIS Desktop 10.5. Im trying to use field calculator to return a max value between other fields in the feature based upon a condition. I am not new to python, ...
3
votes
1answer
56 views

Use field calculator to calculate geometries with a different SRS than the dataset itself

I have a polygon dataset containing hundreds of rectangle map 'frames' that represent map extents across the CONUS. The dataset containing the frames is in EPSG:3857, but the frames themselves ...
3
votes
1answer
70 views

Using the field calculator in rule based symbology

I am trying to categorise my site points by species group with rule based symbology; e.g. bat uses the formula "Group"='Bat' But I would also like to have a different symbol for where there are ...
4
votes
1answer
52 views

Referencing a polygon layer in the field calculator of a point layer to make a virtual field

I have a polygon layer that shows the counties of England and a point layer of project sites. I am trying to make a new virtual field within the point layer that will reference the county that it is ...
0
votes
0answers
18 views

AutoIncrement based on Field Value [duplicate]

Is there any way to automatically restart the AutoIncrement () function based on the Field Value on ArcMap? I am developing a model in ModelBuilder to name parcels automatically. The polygons are ...
6
votes
3answers
231 views

Use field calculator QGIS: if value in one column, then value in new column

I am having troubles using the field calculator to get what I want. One column in my attribute table is named 'Taxa' and has a set of species in it. Species are separated by #. I want to make a new ...
1
vote
0answers
14 views

Populating a text field based on another text field using Python parsing in ArcMap field calculator

I am trying to populate a text field 'Subunit' based on another text field 'ACEC_Name'using the python parser in the field calculator (ArcMap). If the ACEC_Name = "Mojave Ground Squirrel" then I want ...
0
votes
1answer
71 views

Adding spaces in string using Python parser of ArcMap field calculator

I am using ArcGIS Desktop 10.6. I have a integer field [no_lot] which contains values in the following format: '3 546 777' I need to transfer the data into a text field for joining purposes. I ...
3
votes
1answer
171 views

Shapefile disappeared from layout view and its symbology changed after updating data source?

I am trying to update a map based on a pre-built mxd template. However, after everything ran successfully (python code below), the shapefile that was updated did not show up on the map. Its symbology ...
2
votes
1answer
50 views

Designing text in QGIS

I want to write cubic meters in QGIS 3, I searched a lot but I didn't find any instructions. Is there a way to write cubic meters as m³?
2
votes
1answer
61 views

Sort or add Rank within QGIS 3 model

I have the following function in order to add a sorting value to a layer: array_find( array_sort( array_agg("field")), "field") This works fine if I use it through the calculator within the ...
1
vote
1answer
69 views

Calculating fields (multiple) with different conditions for each field using ArcGIS Pro

I have a population dataset where I want to reclassify the age groups and include gender. I have the field "gender", 1 for men and 2 for women, and the field "age". One row for each person in the ...
0
votes
1answer
32 views

Adding two to every value of field using ArcMap Field Calculator

I am working on a road network and each section is assigned a certain value and increases by 1 each section until it gets to around 500 which is the end. A change I had to make was adding two ...
0
votes
1answer
54 views

Iterating through geodatabase and assigning field value based on spatial location using ArcPy

This is very similar to Python script to iterate through geodatabase and assign field value based on spatial location and Assigning field value based on location without join just different data. ...
3
votes
1answer
63 views

Auto populate qgis file name with no file extension?

I'm looking to be able to auto populate an attribute field with the project file name either by a virtual field or default option in the properties. The "@project_filename" expression always produces ...
0
votes
1answer
42 views

Iterating over table to create chainages using Python in ModelBuilder

I routinely have to do the following workflow: Map GPS points;- Create lines based on those GPS points; Split the lines at a set interval distance (every 50m, every 100m etc.) Add from / to fields ...
1
vote
0answers
43 views

QGIS $length returning incorrect values

BACKGROUND: At 3.8.3 I have several line shapefiles, each with CRS EPSG:2927. This is a CRS that I am familiar with, whose units are in feet. When I use the field calculator with $length to create ...
4
votes
1answer
98 views

QGIS Field Calculator provides incorrect answer when using the Maximum function

I'm using: The field calculator in QGIS I'm trying to: Find the winner of each election Problems: When there there is NO WINNER in an election, the field calculator incorrectly picks the ...
1
vote
1answer
52 views

Case - when in two layers

I'm trying to do an operation on a polygon layer to ask a different layer and if a condition is met then do an operation. It would be something like that: Case when ("DAP-OSM-BuildingsH-0m",'BuildCat'...
1
vote
1answer
107 views

ArcGIS Pro Field Calculator Python IF statement

I'm attempting to populate a newly created field with values dependent on an existing field. The new field has text data type. The existing field is double data type. This is the python code I've ...
1
vote
2answers
471 views

Adding Hyphen between text in Python Parser of ArcGIS Field Calculator

I have list of numbers like this (S20170146) and I want to turn them to this format(S2017-01-46).Basically, I need to add "-" between the numbers. I am using Arcmap I know how to use feild calculator....
2
votes
1answer
41 views

Using field calculator to populate one column using other data in same table in ArcMap

I'm not the best with using the field calculator of ArcMap and I'm unsure of what's wrong with my VBScript Basically the new column needs to contain data pulled from the same row in the following ...
0
votes
0answers
32 views

Updating Date Field based on date value ONLY from another field using ArcGIS Field Calculator

In ArcMap 10.4 I have the following code in Pre-Logic Script Code Section in Field Calculator with python option selected and show code block: from datetime import datetime def myfunction(date_text):...
0
votes
1answer
33 views

Calculating New Field using Python Field Calculator From Two Fields Returning Specific Numbers

I have never used the SQL function in the field calculator and need some guidance. I am attempting to calculate new field data (date update) using python for a client that will look at first at one ...
0
votes
1answer
62 views

Calculating values in field to round up to 1 if value is greater than 0 using ArcGIS Field Calculator?

I am prepping vector data for raster conversion and analysis. In order to prep the data I need to have a field that represents data/no data (1/0). I built a model that outputs the necessary features ...
-1
votes
1answer
46 views

What does if-else code do?

I just started a new job and in one of the procedures I was given for one of my tasks I found this piece of code. It just adds a comment to a field that's already filled up. For instance, field1 might ...
1
vote
0answers
56 views

QGIS: Update geometry via geom_from_wkt('POINT(X,Y)') - how to correctly parse string columns?

The columns containing X and Y strings look like -1234,56 So far i tried: geom_from_wkt(concat('POINT(',replace("wbr_komplett.X",',','.'),',', replace("wbr_komplett.Y" ,',','.'),' )')) and also: ...
2
votes
1answer
61 views

QGIS Measure Distance Using Field Calculator

I have a point shapefile with 80K+ records. Shapefile is projected in wgs84. The shapefile contains fields with the latitude and longitude of the point. I need a new field that contains a distance ...
2
votes
0answers
49 views

Auto populating attribute table with lat and lon in QGIS

is there a simple way (without writing script or Python skills) to auto calculate and auto populate lat and lon attributes in QGIS? When I manually add new points or move existing points in my layer,...
2
votes
1answer
41 views

Adding $length on the fly when adding line feature

is there a simple way (without writing script or python skills) to auto calculate and auto populate length attribute in QGIS? When I add a new line feature in my layer, I'd like the attribute length ...
1
vote
2answers
61 views

Filling attribute tables with values from the same attribute table

Just wondering if there's an easy way to fill null values in one column in an attribute table with values in another column of the same attribute table by just writing a query "just the "null values" ...
2
votes
2answers
55 views

Finding and replacing with if then else statement in field calculator of ArcGIS Pro?

I have a column of strings that always start with the first two characters being numbers, like 39 or 07, etc. In a new column I want to process the original column so that I replace any of those ...
3
votes
1answer
74 views

Counting layer segments in QGIS Field Calculator

I have a segmented line (road) dataset and I want to get the number of times each road is segmented. In SQL it's just SELECT RoadMntnc, count(RoadMntnc) AS count FROM clip_DSC_Roads GROUP BY ...
0
votes
0answers
39 views

Adding minimum point Z of polygon using ArcGIS Field Calculator?

In the middle of a ModelBuilder tool I created, I have a Z enabled feature with multiple polygons. I want to add on a specific field of this feature, the lowest Z value of each polygon. I know this ...
1
vote
2answers
88 views

Calculating frequency in Field Calculator

I have a table with many instances of duplicate values. My end goal is to have three columns: "The Value": a file name. most are non-unique "Duplicate Instance": "this is the 1st time this file name ...
1
vote
2answers
99 views

Regex to get unique values in field using QGIS field calculator

I need to get the unique values from a field. (?<=,|^)([^,]*)(,\1)+(?=,|$) Works in an online test but I get invalid expression in QGIS Field Calculator. How can I rewrite this in QGIS Regex ...
1
vote
1answer
190 views

QGIS 3 Graphical Modeler field calculator with attribute's parameters

I want to make a model with a vector layer to calculate the sum of two parameters contained in the attribute table of the layer. I want to create two variables in the model, the name of the two ...
1
vote
1answer
51 views

Extracting 2 groups of numbers from string in QGIS Field Calculator?

I have an attribute field that contains strings like "iuyluf45567kjyyr347fklj". All strings contain various amount of characters and digits (there is no clear pattern) but each string contains 2 ...
2
votes
1answer
57 views

ArcGIS Pro calculate field using arcade not working? [closed]

Im trying to calculate a field called "bark t/ha" using the following expression: if ($feature.Barkfuelhaz =="Low"){ return"0"} else if($feature.Barkfuelhaz =="Moderate"){ return"1"} else if($...

1 2 3 4 5 35