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
3 votes
1 answer
29 views

Field Calculator in Graphical Modeller always returns 0 or NULL

I made a simple graphical model: A Vector Layer input with a corresponding Vector Field vf input. A Field Calculator is used to calculate a new field's value based on the selected Vector Field's value ...
user avatar
  • 8,624
1 vote
2 answers
22 views

How to replace value of cell QGIS

I have a column named foo and I want to replace certain values from the cells in this column. foo is a string column. The values are 1, 01, 2, 02, 3, 4, 010, 12, ... I tried replace("foo",'...
user avatar
  • 3,125
1 vote
1 answer
33 views

How to use the field calculator to generate an autoID

I am trying to get the Field Calculator on QGIS to create an autoID and I am using this expression '5EL_' ||@row_number It works in the preview, but when executed the field is blank. How do I fix ...
user avatar
1 vote
1 answer
50 views

Concatenate points values in a field of a line

I'd like to know how to concatenate points values (attribute data), using fields calculator of QGIS, putting this concatenation in a new field of the linear feature which connect some points of these. ...
user avatar
  • 693
5 votes
1 answer
79 views

Finding how many holes are in polygon using ArcMap

I have many polygons, and I want to know how many holes are in the polygon using field calculator. Like this polygon that has three holes.
user avatar
  • 51
1 vote
0 answers
19 views

Using Parse Path as Variable in Calculate Field with ModelBuilder of ArcGIS Pro

I am trying to use the PPName field in Calculate Field, but it errors each time. I had added %PPName% in the calculate field code box for Arcade. Is there something else I need to do to be able to ...
user avatar
  • 51
1 vote
1 answer
29 views

Convert virtual field to "physical" field?

I created a virtual field "attr" for a vector layer in QGIS using a expression for the values. These values will be updated as data changes. How can I convert/materialize this virtual field ...
user avatar
  • 8,624
4 votes
1 answer
39 views

Filter array with a field value

I need to filter filenames (like DJI_0147_3_5.jpg) in an array, and the code below works, but, where you see a 3 in regex, I need instead a field value. In the array output (sourcefile field) we have ...
user avatar
2 votes
1 answer
101 views

Field Calculator for Multiple Fields

I am trying to get field calculator to work on 2 fields with multiple lines. Trying to have anything within RS10/R10 > 100,000 to return 1 if not then 0, also same results RS15/R15 > 150,000, ...
user avatar
  • 23
1 vote
0 answers
25 views

Using Filter-Argument in Sum-Expression

I am a QGIS-Newbie who is trying to get familiar with the Field-Calculator. I want to sum up the "Length" of all objects with "Calc-ID" of value 1. I know it is possible to select ...
user avatar
3 votes
1 answer
63 views

How to remove bullet point formatting from QGIS attribute table using field calculator

I inherited a .gpkg (no CSV or shapefile) in which the attribute table has a single column containing the relevant non-spatial data. The contents (string) are set up with a <table><ul><...
user avatar
  • 31
0 votes
1 answer
58 views

How to delete almost "identical" line features?

I have almost identical lines with the same attributes, but the lengths are slightly different (for instance 0.01m) how to find and delete them? I've tried "topology check" and "select ...
user avatar
1 vote
1 answer
64 views

Identifying the maximum value of each row in attribute table

I am trying to identify the maximum value from specific columns for each row in the attribute table of my shapefile. Therefore I wrote the following script (as part of a bigger script): layer = ...
user avatar
  • 67
0 votes
2 answers
48 views

ArcGIS Pro Field Calculator: Updating each row with a minute added to previous time

I'm trying to update each row in my point shapefile with a date. What I want is the first row in my below table to read 7/14/2022 12:00:00 AM, second row to be 7/14/2022 12:01:00 AM, third row to be 7/...
user avatar
2 votes
2 answers
49 views

How to autopopulate cell every time a new feature is created in QGIS?

So I am working on a project with QGIS where every time I place a new point, I want the value for the area field to be automatically set to 32 sq ft rather than me have to use the field calculator ...
user avatar
3 votes
2 answers
199 views

Calculate a new field containing X and Y coordinates

I am using QGIS 3.22. I wish to add a field that will represent X,Y or Lat Lon values I managed to create a field for X (using $X) and a field for Y (using $Y) but how do I combine them to one field ...
user avatar
  • 335
1 vote
1 answer
43 views

Update Attribute Table on clipped shapefiles using QGIS

I would like to find a way to automatically update the attribute table for shps generated from the clipping tool. My interest is to get an updated area calculation. All my new shapefiles would ...
user avatar
1 vote
1 answer
40 views

Summing up fields with field calculator in PyQGIS

I am trying to sum up the content of the fields of my attribute table that have the string _Wert in their name. I tried to do it as shown in the following algorithm. But something is wrong with my ...
user avatar
  • 67
0 votes
1 answer
18 views

Adding field and calculating field values based on a current field using ArcPy [closed]

I created a new numeric field (FloodValues) and need to populate that field based on values from an existing text field (ClassName). There are seven different values in ClassName field so I need to ...
user avatar
  • 9
0 votes
1 answer
47 views

Insert x number of vertices on a Polyline with field calculator or Python?

I've seen Adding vertex set distance from first or last vertex in polyline? which is similar to what I am trying to do, except instead of inserting one vertex a distance from the start point and all, ...
user avatar
5 votes
2 answers
194 views

Ordering polygons from north to south in QGIS

In QGIS 3.10 I want to order 22 polygons north to south based on their position using their centroids. I have used the centroids tool to determine where their middle is. But now I'm not sure now how ...
user avatar
  • 53
2 votes
2 answers
144 views

Add a consecutive number at the end of a text in attribute table

I want the first column (ID_1) here (see image) to have numbers at the end of the text. For example: Column 1: GI_01, GI_02, GI_03 and so on. I used concat expression but it doesn't work at all as you ...
user avatar
5 votes
1 answer
135 views

Midpoint coordinates from line in Field Calculator (QGIS)

I'm looking for a way to collect the mid-point coordinates of my LineString type Shapefile using the Field Calculator. What I've already tried was x(centroid($geometry)), but this calculates the mean ...
user avatar
2 votes
2 answers
37 views

QGIS field calculator get value of spefici cell

How can I access the values of specific cells in my attribute table in QGIS in the Fieldcalculator? For a calculation I need two values of the column "height" with a certain ID and not ...
user avatar
2 votes
0 answers
27 views

How to export KML file without having layer name in front of field name in QGIS

I output the KML file from shape file (line). It's include the description of the distance of line. When I output to KML, it showed the layer name in front of Field name (e.g- 11:Descriptio - 648.38 ==...
user avatar
4 votes
2 answers
54 views

Subtracting the two consecutive attribute values in attribute table (QGIS)

I need to calculate the difference in the attribute value between consecutive features: Is it possible to perform the difference using Field Calculator in QGIS? I can think of acessing attribute ...
user avatar
0 votes
0 answers
21 views

Find coordinates of nearest polygon for multiple points QGIS

I successfully used the function suggested here. However, I do not know how to iterate the expression for each point of a Multipoint file, to find the coordinates of the nearest point on the polygon ...
user avatar
  • 55
0 votes
1 answer
49 views

Iterating through Calculate Field using ArcPy

I have three shapefiles as points that I am trying to create new fields for and fill in the fields with a string descriptor. I am then trying to merge all three point files deleting every field but ...
user avatar
  • 51
1 vote
1 answer
82 views

QGIS - expressions with fields from a related layer

In QGIS I have: a point layer; a table; a relation (Project > Properties > Relations) 1 to many between the points and the table; What I need to do is to set a graduated symbology on the layer ...
user avatar
  • 348
6 votes
1 answer
132 views

Excluding zero values in proportion calculation in QGIS

I'm trying to calculate the proportion of seven fields. It is easy to divide the sum of seven fields by seven, but since some fields have zero values, I want to exclude them from the calculation. For ...
user avatar
  • 123
1 vote
1 answer
41 views

Subtracting area of a specific set of raster values from polygon area using QGIS

I am currently working with parcel data and a raster slope analysis in % change I created with DEM data. I symbolized the slope analysis discrete 0-2.5%, 2.5-5%, 5-7%, 7-12%, 12+% and overlayed it ...
user avatar
1 vote
1 answer
42 views

Nearest points from different id

I'd like to know how to get nearest points of the layer "a" to another point layer "b", using fields calculator of QGIS. Layer "a" has points with 2 different id (1,2) ...
user avatar
  • 693
4 votes
1 answer
96 views

Getting index of selected rows in QGIS Field Calculator

Suppose I make a selection on some layer and I want to apply some function on only those records. I know there's a box you can check in the Field Calculator for this, but is there a function/...
user avatar
  • 635
5 votes
2 answers
137 views

Getting list of values from column in QGIS

I have one "column D" with a b c values for my entities (1-2-3-4). Something like that : 1. b 2. c 3. c 4. e 5. j 6. b I would like to generate a list of each different value of "...
user avatar
  • 387
1 vote
0 answers
38 views

Trying to calculate a field with code block but it is not filling the fields [closed]

I am using ArcGIS Pro calculate field. With this I want to fill the null values of a new field from another field using if and elif statements. The other field is "yearsINT" which is a short ...
user avatar
2 votes
1 answer
75 views

How to save model parameters into the attribute table in QGIS?

The problem: I have a model with several input parameters (e.g. input_holesize, input_threshold etc.). The model creates a polygon layer as its final output. I would like to save the parameters into ...
user avatar
  • 1,508
1 vote
1 answer
63 views

Need to find difference between times (saved as strings)

I’m attempting to calculate the duration that fishermen spend at a single location. However The data given to me is a little funky and I was able to get the two times extracted from a column that ...
user avatar
  • 11
0 votes
1 answer
40 views

Using Code In Fulcrum to auto populate a child field with a value from a parent field

I am unsure if anyone on here uses Fulcrum to collect map data but I imagine code is the same or similar. I have an app I am creating with a parent form that contains FeatureID and X and Y Co-ords. I ...
user avatar
0 votes
1 answer
25 views

How to use CalculateField_management if I add values from a list?

I have a list and I want to add the elements of this list to the field of attribute table. So that Row1 = 'apple' Row2 = 'banana' Row3 = 'peach' Row4 = 'melone I tried this: my_list = ['apple',...
user avatar
4 votes
1 answer
66 views

Creating new attribute field gained by areal intersection in QGIS

I am trying to make a new attribute field which will differentiate points, vector layer, which lie inside and outside of a polygon layer. I tried like this: CASE WHEN '...
user avatar
1 vote
0 answers
24 views

Can I use the function for 'decimal minutes with suffix' from the map layout tool (grid) in the field calculator of QGIS?

I want to generate a table of sites with GPS device conform position markers for field work and use the format 'Degree Minute with Suffix'. I see it is predefined in the 'Map Layout Grid' context to ...
user avatar
  • 3,483
2 votes
1 answer
53 views

Getting line length of geometry of parent feature as default value in child feature in QGIS

I have: a parent line-layer 'MyParentLineLayer' (referenced layer) with a field "parent_uuid" (referenced field). a child geometryless-layer 'MyChildLayer' (referencing layer) with a field &...
user avatar
1 vote
0 answers
48 views

How to sum-up values of a column A, with same ID in column B in QGIS field calculator

In my QGIS, I have a shape file that already contains a column stating the size of each urban green space and a column that holds the area ID (equal to a zip code). Via the field calculator, I would ...
user avatar
  • 21
1 vote
1 answer
128 views

Adding a column to a Google Earth Engine feature collection and add names to it using ID

I am new to Google Earth Engine(GEE) and I think my question may have a very simple answer. We can easily assign names to a point shape file by using Arcmap and Field Calculator but I don't know how ...
user avatar
  • 21
0 votes
1 answer
70 views

QField - Fields automatically filled when supposed NULL [closed]

Here is my issue : On a QField project, I have few layers depending on from each other. When "Compartment" is modified, then "ID" is modified and "Compartment value" ...
user avatar
  • 131
1 vote
1 answer
83 views

Aggregating child features with parent attribute values in QGIS

I found this question when looking for my answer Referring to the parent layer with aggregate functions in QGIS I need to do something similar. In another words I need to join attributes by field ...
user avatar
0 votes
0 answers
11 views

Extract numbers from a sequence? (numbers only) [duplicate]

I'm new at using the calculate field function and was looking for some help. I'm trying to extract numbers from a sequence to put into another field. My sequence looks like 123-456-78910. I need the ...
user avatar
4 votes
1 answer
123 views

What is meant by 'current feature' when using the field calculator or expression builder in QGIS?

I am curious about field calculator and expression builder language in QGIS. For example, $area returns the area of the 'current feature'. Does 'current feature' refer to all features of a shapefile ...
user avatar
  • 75
0 votes
1 answer
41 views

Using Field Calculator to put file name into field

I am using ArcGIS ModelBuilder. I want to use Field Calculator to put the file name into a field. I created a field using add field. But I don't know the function to call the file name. What I've ...
user avatar
0 votes
0 answers
116 views

Contingent values in ArcGIS Online - Need to update domain value in field based on another field value

I am trying to build a very simple calculation (or so I believe it should be) in Field Maps. I want the field, we'll call it "Calculations", to populate either "Compliant" or "...
user avatar

1
2 3 4 5
46