Questions tagged [field-calculator]

allows you to perform calculations on the basis of existing attribute values or defined functions in QGIS, ArcGIS, etc.

Filter by
Sorted by
Tagged with
1
vote
0answers
15 views

Field calculator expressions in graphical modeler (QGIS)

In QGIS 3.18. I am trying to build a model that will be used by others for a repetitive workflow involving a series of field calculator expressions. The idea is to create a new field, populate it ...
1
vote
1answer
26 views

Using Calculate Field with ArcPy

I have field that includes 2500 records with name RASTERVALU and type Double. I want to add another field with name Qi. My expression for Qi is equal to RASTERVALU but I don't know correct syntax. ...
4
votes
2answers
226 views

Refactoring several attribute fields at the same time

I have some data from the field survey. In the field, I write down integers that I want to expand afterward. What I do is using the field calculator and something like: CASE WHEN A is 1 THEN 'foo' ...
0
votes
0answers
26 views

How to edit two field have the same domain at the same time in ArcGIS?

I have two layers (Parcel and Building ) with fields that have the same domain, for example ; layer (Parcel) has fields with names ("Building status", "Land Use") with domains (...
-1
votes
1answer
35 views

Autofilling attribute fields with text using ArcGIS Pro

I have a shapefile containing over 18,500 polygons which are classified land uses of Ireland. I am trying to then put these classifications into a macroscale as per CAFRE directive - urban, suburban, ...
0
votes
1answer
22 views

ArcMap 10 / ArcGIS Pro 2.8 - identifying records for deletion

I use Esri products, predominantly ArcMap, but am interested in how to sort this in ArcMap also (if it is different). I have a shapefile of over 2800 polygons. All the polygons have a reference such ...
3
votes
4answers
159 views

Returning column name of the max value

I am working with some age group data in QGIS based on point counts within a polygon grid and I would like to calculate the max value from a row with 11 different age groups in order to get the ...
-2
votes
1answer
64 views

If statement errors in ArcMap [closed]

I wrote a rather complex code but something doesn't seem correct. It returns error executing function. Can you fix my code? def reclass(siteclass,tempzone,rainzone): if 'ST' in siteclass and '...
4
votes
3answers
166 views

Extract left part of field with regexp_substr after two specific charaters

I would like to create a new field on my table with only the part at the end of another field ("stop_name") which contains things as 'STOP_01_1_S1'. I want to extract what is on the right of ...
4
votes
1answer
66 views

Distance matrix along line layer

I have a point layer which represent transport stops. Each stops have an id and the transport line id. I would like to have calculated the distance between every stops on the same transport line (...
2
votes
1answer
33 views

IF statements to rank different ranges with field calculator in ArcMap

I have a simple calculation to perform using the Python Parser in ArcMap but am running into some trouble when it comes to coding the ranges of values. I have three different fields: mean temperature, ...
1
vote
1answer
35 views

ArcGIS Field Calculator using Python Parser gives ERROR 000989 [closed]

I am attempting to learn how to update a field using Python with Codeblock showing. The script is supposed to return a value to a text field based on a numerical value in two float fields but I keep ...
1
vote
1answer
31 views

Populating a field based on values in other fields using ArcGIS

I would like to do a simple calculation using VB script or Python. Here is a screenshot of my field calculator which continuously seems to run into errors. Basically for the SITE CLASS field I would ...
6
votes
1answer
70 views

Calling phone number directly from QGIS

I would like to call a phone number from QGIS using the installed CTI program. The phone number is stored in the feature attributes. My intention is to open the CTI program after using the identify / ...
2
votes
1answer
59 views

Comparing overlapping features using Field Calculator in QGIS

I have a building dataset and I am trying to perform a spatial analysis, to determine which building should be developed as a 3D model, for a mapping project. Because in some areas the building ...
4
votes
0answers
43 views

QGIS Field Calculator NaN error messages dependent upon variable type?

I have a layer which contains roads. I am using the Field Calculator to compute some statistics based on different attributes. Using QGIS 3.10.14 I am running into an issue using lengths. I have ...
0
votes
1answer
27 views

Inserting space into string using ArcMap Field Calculator

I am using ArcMap 10.7.1. I want to insert a space into a string between specific parts of the string using Field Calculator: !FIELD! .replace("F'target", "F 'target") Neither 'F' ...
2
votes
1answer
48 views

Fill features' attributes from line layer depending on what point layer is snapped to their start_point and end_point

I have LineLayer with start_point and end_point field attributes which can snap to either PointLayer1 or PointLayer2. Using the field calculator, I would like to make an expression which would take id ...
4
votes
1answer
78 views

Averaging shapefiles using QGIS

I am working with the shapefiles from the OSPAR on fishing intensity. I have the shapefiles from 2009 to 2017 I would like to "merge" them in order to obtain a mean value for all the ...
2
votes
2answers
53 views

Moving cells with field calculator of ArcGIS Pro

I am trying to move field entries down by 1 in an attribute table, between a certain row spread. I would like to move all the entries in the 'key biomechanical features' column down by 1 row between ...
0
votes
1answer
54 views

Joining all atrributes of one column in point-layer like number in multiple columns of a polygon-layer like number_1, number_2 etc. in QGIS

I got a point-layer Points where all points lying exactly on the vertexes of the polygons of a polygon-layer Polygons. How do I join all numbers of the point-layer to the polygon-layer? All algorithms ...
1
vote
1answer
56 views

QGIS: Calculation of area percentage is above 100 %

When I use the field calculator it gives me a value above 100 % (Pic. 1, red mark). As you see in the picture the result is at 100,05 %. At other calculations its even higher, sometimes up to 100,25 %....
3
votes
1answer
67 views

QGIS: Not possible to change the number of decimal points when using results of field calculator

When I use the modeler (Pic. 1, Layer: "Gemeindegrenze/2500 m Radius" - yellow mark), the results are always shown in a value with 16 decimal points (Pic. 2) and It seems to be impossible to ...
3
votes
1answer
43 views

Adding new row by command in field calculator in QGIS

I am actually trying to create a new field in a table with the Model Builder (Field calculator function). Is there a command that creates a new field, so I can do calculations directly in that new ...
1
vote
1answer
52 views

Splitting population among overlapping polygons

I'm quite new to QGIS. I have one layer that is a quadratic grid with a different population in each square, and I have another layer with two polygons that I got from the Travel Time plugin. I want ...
1
vote
1answer
45 views

Converting date field using ArcMap

I need to convert the date field in the feature class. The original date format is 15-Jan-2012, 27-Apr-2012, likewise. How can I convert it into MM/dd/yyyy format?
4
votes
2answers
75 views

QGIS: concatenate_unique several columns in attributes table

I have a table with points representing villages. Its columns represent the place of the village in different historical periods. Sometimes the names are the same in different columns. Now, I want to ...
1
vote
0answers
21 views

How to reduce the impact of 0 values on grid layer-based spatial analysis in QGIS

Several days ago, I asked about Calculating average data of neighbour grids based on location and returning data to grid in QGIS, in order to understand the trend of distribution of some attributes ...
1
vote
1answer
49 views

Adding leading zeros to string value in QGIS [duplicate]

I have a "field" with string values like field new field 3 0003 5 0005 22 0022 999 0999 What is the right expression for the QGIS Field calculator to get a 4-character string-field ...
3
votes
3answers
189 views

Splitting string with house number in QGIS Field Calculator

I have a string field with housenumber which contains values like: housenumber 5 12 a 15 b 18 c What are the right expressions for the field calculator to write only the number in "field1&...
1
vote
0answers
33 views

Model Designer: Using Input in Advanced Python Field Calculator

I am fairly familiar with QGIS's Model Designer, but only have a basic grasp of Python currently. Due to a more complex requirement, I have needed to use the Advanced Field Calculator for some ...
1
vote
0answers
20 views

Removing tilde from attribute table

I am trying to remove the tilde from a few fields in my ArcGIS Pro attribute tables. I was given a few .txt files that I need to join to some landgrid parcel data, but can't do so until I have ...
1
vote
1answer
43 views

Getting coordinate vertices of a polyline in QGIS

How can I get the (x,y) coordinates of the vertices of a polyline in QGIS? I do not find the function in the field-calculator I can find the coordinates for each point, but I am not able to highlight ...
5
votes
1answer
66 views

Query for adding new field that is the sum of months fields

I have a table where fields are a specific month of a year. And I just want to add a new field that is the sum of the months fields that are ticked. Practically speaking I need to know the duration of ...
1
vote
1answer
50 views

Counting all line features that overlap specific one from different shapefile

I have two shapefiles: 'Lines' and 'Base-line'. One attribute inside 'Base-line' is the number of 'Lines' features overlapping that specific 'Base-line' feature. It basically represents the number of ...
3
votes
2answers
133 views

Calculating average data of neighbour grids based on location and returning data to grid in QGIS

I have generated a grid layer from a vector layer in QGIS, and merged the point attribute into the grid layer by "joint by location". I now need to: calculate the average of some ...
2
votes
2answers
97 views

Script removes all data from fields when using custom function in Field calculator

I am trying to clear entries in columns using the field calculator but with my current script, it removes all the data from all the rows. Basically, if the Historical column is equal to 'Historical ...
2
votes
1answer
26 views

Translate field values from Italian to English

I want to convert the dataset for 19th century factories from Italian to English. I was thinking about typing it out in the Field Calculator like so (note the Classe column needs to be converted and ...
0
votes
0answers
17 views

Setting fields in batch process of QGIS

i'd like to know how can i set the fields of shapefiles in a batch process of QGIS (one setting for all shp) using the field calculator: I'm using an expression like this, taken from an another post: ...
4
votes
1answer
145 views

Calculating area of polygons without script in QGIS Field calculator

Whenever I click the Field Calculator in the attribute table, I am prompted to created a script in order for it to calculate the area of a polygon. However, I do not want to use code in obtaining a ...
1
vote
1answer
55 views

Changing field values with PyQGIS [duplicate]

I have a shapefile with almost 50,000 features and 2 fields. I want to change all the attribute values of the second field, and I remember that in QGIS 2 there was a way to save to disk ONLY at the ...
1
vote
1answer
34 views

Using IF Statement to return value from another field of the same attribute table with Field Calculator

I am trying to get the field calculator within QGIS 3.20 to create a new field ("*NewField*") that matches text in another field ("name1") when a condition (= 1) is met in another ...
4
votes
2answers
59 views

Iterate multiple soil fields through Calculate Field

I understand this can easily be done manually using Calculate Field, however I'm looking to automate this process using ModelBuilder as it is a requirement of the current module. I have 7 Weather ...
6
votes
2answers
205 views

Using a value as a field name in a QGIS expression

Regarding SQL expressions in QGIS: Based on the value of the field "_majority", I want to subtract the value of the field with the corresponding name from the field "_count". Using ...
1
vote
0answers
31 views

ArcGIS pre-logic script code does not work

I am trying to define a function in pre-logic script code on ArcGIS 10.8. While running it, it shows the failure. I am not able to figure out the reason behind it. I have defined the following ...
2
votes
3answers
228 views

Summing multiple fields in QGIS

I have a layer/table with several fields I need to sum together to create a value in another field. I have tried using aggregate() and sum() but I can't get the a correct syntax to be able to do the ...
1
vote
2answers
51 views

Multiple Points attribute information into one Point in QGIS

I have three points from two layers ( Point 2539 and 2538 from one layer lets say X and point AL101974 from layer Y ) ( Refer figure-1 below). Point 2539 and 2538 has multiple attribute information ( ...
1
vote
1answer
53 views

Using CASE WHEN AND for multiple scenarios

I have the following cases where I would like to 1. Determine if a feature has a lower elevation than another and is on the same line feature. If it is then call it 'dwn_cross'. 2. If a feature has ...
1
vote
2answers
43 views

Replace value in QGIS using field calculator

How, through the field calculator, can I replace the value? But it should not change in two-digit and three-digit numbers. I need to replace '7' on '', but not 57. Value 7 can be anywhere in the line....
0
votes
0answers
29 views

How to replace a word using python parser in ArcGIS

I have the names like below Rua Jose Rovira Travessa Jose Rovira Rua Antônio de Jose Belém I need to replace the name José where the Jose. I'm trying this: !field!.replace("Jose","...

1
2 3 4 5
42