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
2
votes
1answer
60 views

Creating index field from number of items separated by “|” in field

I am trying to create an index field from a intersection layer I have created using the SAGA, polygon self intersection tool. The SAGA tool outputs a field which shows which buffers intersect each ...
1
vote
0answers
13 views

Creating calculation that uses data from same field, but from different survey submission, using Survey123

I need to create a survey for a Field Technician to use during a groundwater sampling event, but I can't figure out if the one section of it is at all possible using Survey123. Every day for a few ...
1
vote
3answers
41 views

ArcPy string concatenation with both forward and back slashes

I am trying to concatenate 2 string variables Var1 and Var2 using python (converting some old ArcGIS VB-based scripts to ArcPy). I need to add a backslash between them. arcpy.CalculateField_management(...
0
votes
0answers
12 views

ArcGIS hyperlink script to assesor maps based on different account numbers

I am adding a hyperlink within the attribution to open up to our local county assessor maps. I am able to get the hyperlink to work directing the user to the map directory to look up based on a given ...
2
votes
2answers
190 views

Python syntax returning only part of the if/elif statement in Field Calculator?

Using ArcGIS 10.7 desktop. I want to reclassify a land use field using Field Calculator. Grasslands are conditionally reclassified using a 'veg_type' field (Avena, or Bromus) and a CWHR land use field ...
2
votes
1answer
45 views

Display_expression function on QGIS 3.14

I would like to know what exactly do the function display_expression introduced in QGIS since version 3.14. The 3.14 Changelog is not clear on it and also reading the GitHub commit didn't help me to ...
-1
votes
1answer
34 views

Python field calculation completed but fails to populate new field

Wrote a script to convert DD coordinates to DM coordinates. Results message says the script completed but field is still populated with Null.
0
votes
0answers
30 views

QGIS 3.10 - Field calculator expression running in Attribute Table and not in Processing Modeler

I use the Field Calculator in the Attributes table and run the operation : "FieldA" - "FieldB", where "FieldA" and "FieldB" are height distances in meter with a ...
1
vote
1answer
30 views

Select By Location and Calculate Field in ArcPy

I have a point shapefile and a polygon shapefile and want to set the field "Present" to 1 if it intersects with the polygon in ArcPy, but I am having trouble with the SQL syntax for select ...
0
votes
1answer
23 views

Is there a way to filter results in the attribute table of a point shapefile by the extent of a second polygon shapefile in QGIS?

I am currently trying to temporarly filter data with in the attribute table to a confined area defined by a second polygon shapefile. The data set to be filtered consists of 100s of points that extent ...
2
votes
1answer
49 views

Concatenating part of string and sorting it using QGIS

I'd like to know how to concatenate part of a string and sort it. For example, i have a FIELD1 (string) and i should have the numbers of the string separated with ';' in the FIELD2. Only the numbers ...
1
vote
1answer
24 views

QGIS: How do I specify the layer for an get_feature expression in the model builder?

I'm trying to calculate a field (Field calculator 2) in the model builder with an get_feature expression which should look something like this attributes(get_feature('LandUse_TD_HYBAS_dissolved_calc', ...
0
votes
1answer
23 views

Calculating Min and Max Across fields while skipping Zeros

I am using ArcGIS Desktop 10.5 here. I have a streets layer that has address ranges in the fields FromLeft, ToLeft, FromRight, and ToRight. I am trying to create a street index csv that has the low ...
2
votes
0answers
35 views

Matching and aggregating data between two overlapped layers using QGIS [duplicate]

I'd like to know how a vector layer can take and aggregate attributes of a field, of another vector layer which is overlapped. For example, a layer T1 has not overlapped records while on the contrary ...
0
votes
1answer
28 views

How to pass a variable in VB codeblock in ArcPy to calculate a field?

How do I pass a variable name - as the variable, not its name as a string - in a VB codeblock when calculating a field in ArcPy? I am using field calculator in a tool I built with Model Builder to ...
0
votes
3answers
40 views

QGIS: How do I write a CASE expression (field calculator) that doen't calculate/change the existing field information if not true?

I'm using a CASE WHEN expression in the field calculator on an existing field which already contains information. The expression is comparing two fields. If these fields match, the result should be 0. ...
1
vote
1answer
37 views

Counting intersections between line and points using Field Calculator? [closed]

I'm using QGIS 3.12 and let's say I have a Layer that consists in Lines that represent 'Rivers', and I have another Layer that consists in Points that represent 'Bridges'. Can I count the number of ...
1
vote
2answers
45 views

Calculating mean value with field calculator for selected records using ArcPy

I want to calculate the mean value in the field z which has Type Zero and write it in Ground field. How can I do that with arcpy? arcpy.MakeFeatureLayer_management(Shapefile, "layer") ...
3
votes
1answer
54 views

QGIS: How do I combine/summarize information from several attributes to one specific attribute?

I have a pretty specific question and I dont know how to approach this. I have a polygon layer for subbasins in the Danube area (HydroShed) which also contains information for water discharge. The ...
0
votes
0answers
33 views

Calculate Percentage population from Vector Grids

I have a vector grids layer of population (shapefile). Each grid represents population in that grid and have the following attributes: Area Population I want to calculate and display the percentages ...
0
votes
0answers
20 views

ArcGIS equivalence of QGIS autofill field using *Default value* by expression and spatial relations

I am trying to find an ArcGIS equivalent for the QGIS operation that allows to fill automatically a field during the digitising using the option Default value by expression in Proprieties > ...
0
votes
1answer
38 views

Add Field doesn't work on ArcPy (ArcGIS) in a loop

I am trying to add a field to each shapefile inside several folders in ArcGIS with Arcpy. I am executing the following code. import arcpy, os # Overwrite pre-existing files arcpy.env.overwriteOutput = ...
0
votes
1answer
35 views

ArcPy Calculate Field management syntax error [closed]

I have list of GDBs each containing Mauza and Khasra Feature classes I want to update fields using string code is as below import uuid import arcpy as ap import os DistrictName='Faisalabad'#'...
-1
votes
1answer
18 views

Separating network data by using attribute table field

I'm trying to separate historic network data (by symbology) that I need in the same shapefile, as my data contains two different types of network "Route" and "Stairs". I tried ...
0
votes
0answers
37 views

How to add Elevation to a QGIS 3.12 attribute table for shapefile points

What code do I use in the Field Calculator of the Attributes Table within QGIS 3.12 to generate the elevation of shapefile points in feet?
0
votes
1answer
27 views

Field Calculating using Python Parser with Standard SQL Query Layers & Views in ArcGIS Pro

I have been given the task to extract PASER scores from a comprehensive table of of PASER_byYear. I would like to take the time to create a view and query layers using SQL, but do to time constraints, ...
0
votes
1answer
13 views

Finding tangent to curve at given point for vector lines using ArcMap

Can anyone tell me how to find the tangent to a vector curve for a given point? So, in the example, how can I figure out the tangent for the red line at the green point?
0
votes
1answer
34 views

The Calculate Field tool causes an error when used in a geoprocessing service

I wrote a tool that creates a table whith errors and fills an error field. Then I published it on the server as a geoprocessing service. But when I run it causes an error But when I comment arcpy....
0
votes
2answers
63 views

ArcGIS Pro Python Field Calculating

I am trying to use Python in ArcGIS Pro to cleanse some data via imported Excel sheets. The expression works, but the Code Block if-else statement to return nothing if !Street_Id! is returns an error....
0
votes
1answer
52 views

Split in ArcGIS 10.8

Working on ArcMap Desktop 10.8; I have a point layer with a field called SITEROAD (string) from which I need to extract ONLY the first word before a space, and put it into a new field, STREETNAME. ...
0
votes
0answers
37 views

QGIS adding two months to a date time

I have two columns one that has the BeginLigeSpanVersion and one that has the end LifeSpanVersion, both kind of noted into Date Time format. I said kind of because usually in the unfiltered unaltered ...
1
vote
1answer
24 views

QGIS modelbuilder Error on expression when similar Expressions Run Fine

I am currently trying to build a algorithm model that does some conversions of a attribute tables. It was working fine in a while I was building things step by step however a new expression does not ...
0
votes
1answer
30 views

Calculate field: expression is not defined [duplicate]

I'm tyring to write a script the allow me to select a layer by location, then calculate a field of the selected feature. But I'm having issue with CalculateField_management. Here part of the script: ...
1
vote
0answers
33 views

Use base file name to reference created attribute in QGIS Modeler

I'd like to drop a field created when using overlap analysis. This operator creates two fields: [layername]_area and [layername]_pc. I want to drop the _pc. The input file name can vary. I've tried ...
6
votes
2answers
180 views

Removing two letters only if they appear at end of a field in QGIS labels

I am trying to remove the letters 'a' and 'o' only if they appear at the end of the field 'name' while labeling. For example, I'm working with names like: Ontario, Manitoba, Alberta, Quebec, Nova ...
1
vote
1answer
30 views

Can you go back and view the equation you put into the field calculator?

If you have an attribute table column that you populated with values using the field calculator, is there a way to go back and view the calculation you input? This is days later outside so I am no ...
-1
votes
1answer
44 views

Extracting numbers from string using field calculator of ArcMap [closed]

I need to move number values one field to another field in ArcMap. There's no need to move any alphabetic string vales. Like attached picture shown having number values too so I want those number ...
4
votes
2answers
110 views

Adding consecutive unique ID starting from 1 for each distinct set of values

I need to add a unique "ID" (using $ID or @row_number) but the problem is that I need to start from 1 to "...n" considering identical values from other field, then, when there is a different value, ...
1
vote
1answer
33 views

QGIS: Converting a { “DisplayValue”: “Value being displayed”, “Value”: “value” } string format from a GeoJSON file

Currently we are trying to to convert a JSON file, which has an attribute table that is too chaotic and needs to be changed. There is certain string format in a few columns that keeps popping up and ...
0
votes
0answers
27 views

Python Calculate Rank in Field Esri

Does anyone know how to calculate the "rank" of a field but within 1-100? For example i have a field called "ValSumBasin" with all these values. I am wanting to rank these values from 1-100. I can ...
2
votes
2answers
61 views

Filling attribute table automatically but with specific values in QGIS 3.10

I'm currently trying to built a database for a cocoa plantation. I would like to know how to fill my database easily with the field calculator. For example I would like to have a specific value for my ...
1
vote
1answer
60 views

Creating new field considering duplicate and numeric values

I'd like to create a new field considering duplicate and numeric values. For example, I have an attribute table with duplicate values in the field1 and numeric values in the field2. I'd like to ...
0
votes
1answer
23 views

How to fill out a field with a matching between an existing field value and a file name in QGIS?

I'm facing a big challenge. I need to fill out new fields using "Field Calculator" in QGIS. What do I need to load in those fields?: URL's containing the path to a image file (we can use the statement ...
0
votes
0answers
20 views

Filter on distance point field and choice field

I have model shop shop class Shop(models.Model): CATEGORY = ( ('BookShop', 'Bookshop'), ('Bakery', 'Bakery'), ('Dairy', 'Dairy'), Shop_category = models.CharField(max_length=200, null=...
0
votes
0answers
18 views

How do I turn on auto increment function for a field that already has incrementing numbers in it?

In ArcMap, I've got an attribute table with two object ID fields. One is active and populates every time I make a new feature, and the other, which is older, is not. They do not match exactly because ...
0
votes
1answer
35 views

ArcPy script doesn't work for TRIM function

I have this code: import arcpy import os def massiveTrim (vrb): y=r"shape path" for i in y: campos = arcpy.ListFields(vrb, "", "String" ) for camp in campos: ...
0
votes
0answers
49 views

Expression in PyQGIS does not work

Now I am trying to create a field column by using Expression on PyQGIS. The following code allows me to create a column. But, I can't get any values on "budgets_Budgets_county" on the "budgets" column ...
2
votes
1answer
27 views

Concatenating fields into a new field-QGIS

I'm not sure what I'm missing here. I'm trying to use the field calculator to concatenate multiple fields into one new. All fields are identified as strings. My expression: concatenate( "Building" ...
1
vote
1answer
45 views

Filtering a value relation selection box with an expresion when one column has string LIKE the other Column

Oke I have setup two value relations between one polygon layer and two tables, this is to make the selection of multiple values possible. The first value relation is not really that important you just ...
1
vote
1answer
34 views

Writing Field Calculator codeblock using Python parser of ArcGIS Pro

The following code isn't working as expected and I'm not sure why: UpOrDown = reclass(!UpOrDown!) def reclass (Z,GP): if (GP == "DT" and Z == "CG"): UpOrDown = 1 if (GP == "DT" and Z ==...

1
2 3 4 5
37