The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [select-by-attribute]

To select data records according to logical criteria applied to their field values ("attributes")

Filter by
Sorted by
Tagged with
0
votes
1answer
53 views

Selecting by attribute by specific characters fields

I have a field "HNR_S". It contains values like "124", "122", "1315", "1465", "15151", "124512642". How can I select more than three numbers?
0
votes
1answer
83 views

Filtering attribute table based on names in another table using QGIS?

I have a shapefile showing a list of district names. I have (currently in Excel) a long list of district names in a table. I would like to filter those districts that are in the other list. I think ...
0
votes
1answer
35 views

ArcPy - Select Layer by Attribute / Delete Selected Layer - SQL

I feel like I've tried so many iterations of this, can anyone assist with how to use ArcPy to selected layer by attribute then delete selected layer? I think my SQL query is incorrect? import arcpy ...
1
vote
1answer
60 views

Cannot select by attribute for new attributes added by join in ArcGIS Pro?

I'm new to ArcGIS Pro and am following some tutorials. I did a join to add some data to the attribute table of one of my layers. Now, when I go to select by attribute and look for those attributes ...
1
vote
0answers
24 views

Automatically select a feature from another layer based on shared attribute in QGIS [duplicate]

I have two shapefiles, A (polygons) and B (points), and I need to select all features from shapefile B that have the same attribute (for example, "Name") as shapefile A, and I need to do this ...
1
vote
0answers
55 views

QGIS: Add attribute from polyline layer to point layer [closed]

I want to add an attribute from a vector line layer to a vector point layer. The vectorline is railwaynetwork. It has been divided into segments automatically. To process the data further I had to ...
2
votes
1answer
54 views

Select by attribute does not work on an indexed field

I came across an issue where I can no longer run a select by attribute on a field (In my example it is "Students_7") in a shapefile that previously worked. Even when I build the query using the wizard ...
0
votes
0answers
40 views

Selecting layer by attribute in Python Toolbox of ArcPy?

I have this code where te input parameters are a shapefile [param0] and a string list [param1]. The second parameter is a list because I want that user select it. class Tool(object): def __init__(...
1
vote
0answers
32 views

QGIS Atlas Feature for multiple polygons with same attribute [duplicate]

I have a shapefile of city blocks in a given city. Each polygon represents an individual lot, but the attribute table includes a column called "sector", that denotes the zone of the city that the lots ...
2
votes
1answer
45 views

How to use SQL queries in arcpy.SelectLayerByAttribute?

I'm trying to select features from a layer that I know exist. I'm using SelectLayerByAttribute_management in arcpy. I have a layer that is properly defined earlier in the code named "tourmaline". I'm ...
2
votes
1answer
54 views

How to extract records with a specific but shared attribute

My goal is to isolate the ID#s observed in Zone C and only Zone C (like IDs 2236 and 3007 in the attached table). There are records for which the same ID was observed in other zones besides Zone C, or ...
0
votes
1answer
30 views

Selection by attribute from list

I need to select a layer with all attributes while the selection comes from a table. With my code I get only empty feature classes and emtey Excel files. The tab_list Elements are the selection value. ...
0
votes
0answers
27 views

Selecting values with date-format by using SelectLayerByAttribute_management with input Parameter

I am working on a Tool which selects records depending on the input value. Works fine, till I want to select date-records. I used def buildWhereClause(self, table, field, value): # Add DBMS-...
2
votes
2answers
77 views

Selecting all values with <Null> by using SelectLayerByAttribute_management with input Parameter

I am trying to select all values with Null by using the SelectLayerByAttribute_management. But the Fieldname in the where-clause is alterable by using the input-parameter. That is what i tried: if ...
0
votes
1answer
53 views

Using input parameters to select layer by attribute

I am trying to create a Python-Toolbox with following Tool: inputFeature: A User has to load a Feature inputField: Then he has to to select a field from the Input Feature inputValue: At the end ...
1
vote
1answer
79 views

SelectLayerByAttribute_management searching with different datatypes

I am trying to use the SelectLayerByAttribute_management in a tool. The tool works like that: The User puts in the Feature which Layer should be selected by attribute -> "inputFeature". Then he ...
2
votes
1answer
63 views

Understanding backslash in arcpy.SelectLayerByAttribute syntax?

I copied this line from Python code, but I don't understand the \" \" around the word District. arcpy.SelectLayerByAttribute_management(Community_areaFC, "NEW_SELECTION", "\"District\" = ...
0
votes
1answer
31 views

Conditional join or query of two layers

I have two layers that I'm trying to conditionally join. One layer JUNCTIONS has junction IDs (NAME) and flooding volumes (Flood_cf) for each junction. I'm interested in identifying and symbolizing ...
1
vote
0answers
60 views

Select Feature Based on Iterate Row Value in ModelBuilder

I have a table showing commuting trips from home to work. home_id represents home and work_id represents work. Now I want to step through the trips table using Iterate Row Selection in ModelBuilder, ...
1
vote
2answers
52 views

In ARCGIS 10.5 mxd I need to put definition query for one layer as Current Year in Year fields , What i need to set the query

I have a feature class and related info in another table, the table having fields as Year, Year having values like - 2016,2017,2018,2019... Presently I Put the definition query for table Year = 2018 ...
1
vote
3answers
273 views

Searching for NULL values in feature class table

I am looking for a way which I can search whole my feature class in ArcMap to find if has any NULL values on it. I know how can I do this with "Select By Attribute", but I am looking for a faster way ...
0
votes
2answers
85 views

1000 features limit using CopyFeatures_management?

I wrote a script to select features from a sql server spatial database based on date, there are thousands and thousands of records. The script runs but when I used the CopyFeatures_management tool, ...
3
votes
0answers
61 views

Select by attributes returning wrong records

I'm trying to select by attributes on a parcel shapefile with 555k+ records using the apn field and the statement is returning records that have completely different values. My initial statement was "...
0
votes
2answers
53 views

Select by Attribute homework help

I am learning how to use ArcGIS and I am unsure how to assign appropriate buffer distance to each lake size classes for a homework assignment, please see the picture below. The goal is to place ...
1
vote
2answers
62 views

Where Clause in SelectLayerByAttribute function resulting in invalid expression

All of the attempts below result in ERROR 000358: Invalid expression Any ideas on what I am doing wrong? I am working within a File GDB and with polygons. Attempt 1: def SelectLayer(val): print ...
1
vote
1answer
34 views

Save Attribute Query

How to save attribute query on qgis 2.14? I have more than 20 queries. The recent queries save only 20 queries. If I can save them, it will be more effiecient.
2
votes
2answers
52 views

Copying only shapefiles which have specific field attribute in another folder using ArcPy?

I have 100 shapefiles that all have 2 fields in common called Type2017 and Type2018. The whole of the fields have only one number (1 or 2 or 3). fo example, Type2017 = 1 or Type2018 = 2 I would ...
5
votes
2answers
537 views

Selecting all features except one using QGIS?

Using QGIS 2.18. I have 346 polygons on a layer and I want to display all but one. In this instance I wish to run a query using field ONSCode but show all except 17UB. I have been trying to use NOT ...
0
votes
1answer
28 views

Select by attributes appears to not work correctly

This table: ca ca1 12333 123330 doing this query in Select_analysis: in the where parameter. ca = 'substring(ca1,1,5)' gives empty feature layer and this: ca <> 'substring(ca1,1,5)' ...
1
vote
1answer
31 views

QGIS assigning accumulating numbers to field records following order of selection using @rownum

I have selected points in QGIS and they have a field (towerno). This filed represents values in the range from 658 to 800 but I want to narrow it from 558 to 700.
0
votes
1answer
44 views

Cannot find results of MakeFeatureLayer, cannot use SelectFeatureByAttribute [duplicate]

I have a goal: take a feature class, select some of the records by attribute, and make a layer for further processing. Should be simple, but I am having multiple problems. Note: I am working in a ...
0
votes
1answer
114 views

Equivalent of 'Left' function in Select_analysis

I tried to find the equivalent of Left fuction because it doesn't work in ArcGis. I found a post that suggested the word substring: the query is: WHERE (IAS.C_A)<>Left([C_A1],5))); and I ...
5
votes
1answer
233 views

Display Multiple Symbols for a single point feature by field attribute vale

I want to create a point feature layer and add points. Around the point I'd like to add icons/symbols and labels based on data in fields of an attribute table.
0
votes
1answer
198 views

ExecuteError: Failed to execute. Parameters are not valid error when SelectLayerByAttribute run in Python 2.7 [duplicate]

I am running a line of code in a Python 2.7 environment using arcpy.SelectLayerByAttribute_management: fl_haz_selects = arcpy.SelectLayerByAttribute_management(S_Fld_Haz_Ar, "NEW_SELECTION", "\"...
3
votes
1answer
54 views

Correct use of SelectLayerByAttribute_management in ArcPy?

What are displayed in the tableName are polygon features in a geodatabase. I would like for each row in a loop to take each row TableName and apply the sql query from the sqlstring field and make the ...
1
vote
2answers
400 views

Not Able to Pass Where Clause in SearchCursor in ArcPy

Can you please take a look at this snippet and let me know why I am not able to properly pass the Where Clause ('"[NAME_1]" = Ohio') in SearchCursor? import arcpy from arcpy import env def ...
1
vote
1answer
497 views

Using select by attributes then calculate field on selection in ArcPy?

ArcGIS Pro 2.3 I want to create a standalone script which runs outside of ArcGIS Pro (for automation purposes), which selects features (with blank attributes) in a feature class and runs calculate ...
2
votes
1answer
90 views

arcpy: Select layer by attribute with SWITCH_SELECTION seems not to work

I have a large feature classes, where a field named "gridcode" contains integers values from 6 to 17. I would like to get rid of features, where the gridcode = 6, 9 or 15. Therefore, I have created a ...
0
votes
1answer
67 views

Selecting multiple partial field contents using ArcGIS Select By Attribute?

I can't seem to get the hang of ArcGIS Select By Attributes SQL. I'm trying to "select all that contain Street and Road and etc." Working with polyline SHP. This works: "NAME" LIKE ('%Street%') ...
1
vote
0answers
30 views

QGis Python featurerequest with lists

I want to select some features and do some actions to this selected features. Something like if attribute in field a is = abc than do something. But the selection will not fit. As written in https://...
1
vote
1answer
323 views

Select by attribute how to only select numbers in a string field

Using a SQL experssion in the "Select by Attributes" table, how would I only select records 1, 4, 5, 8 and omit the rest (I only want to select values that are entirely numbers)? What I have right now ...
0
votes
2answers
277 views

NULL value not equal to empty value for attribute

I have a feature layer in a gdb. It has an attribute named uniqueid. Some of rows have a value for uniqueid and some do not. I am trying to select only the features that have a value (are not blank). ...
0
votes
2answers
47 views

Select by Attributes query ArcMap 10.5.1

I am trying to find capitals with a population between 200,000 and 300,000 and I do not know how to build the query correctly. Here is what I have, but it doesn't work:
2
votes
1answer
1k views

AttributeError:'QgsVectorLayer' object has no attribute 'setSelectedFeatures' PyQGIS 3.0

What is the new expression of setSelectedFeatures in PyQGIS 3.0 ? I wrote the following code: def verCode(layername): layer = QgsProject.instance().mapLayersByName(layername)[0] selection= ...
3
votes
1answer
108 views

Select features in a polygon that covered the most by features of another polygon layer QGIS

I am working in QGIS. I have 2 polygon layers, One layer is the parcel polygons layer for a county called "Parcel" The other layer is the building footprints polygon layer for the same county called "...
1
vote
3answers
103 views

Invalid expression with string/text

I'm trying to use ArcPy and Python more since the ability to just point and click isn't that marketable. I've been using ArcPy for Select by Attribute. It works fine when I try to select attribute ...
1
vote
3answers
296 views

Delete ONLY selected features in ArcMap / ArcPy

I have a layer where features are selected by location in relation to one or more other layers (selection_type is ADD_SELECTION) in a loop. After that, zero, one, some or all features are selected. I ...
1
vote
1answer
169 views

Expression to select features by comparing attribute values

I'm working in QGIS and I have a point layer with two fields and I'm trying to compare the accuracy of the distances in feet. One field highlights the old calculated distances and another field ...
1
vote
1answer
108 views

Selecting a feature by field value

I have a layer called 'Colorado' that has an attribute 'FIPS_CODE'. The values are numbers as a string. I am trying to use arcpy.SelectLayerByAttribute_management inside my Python script to select the ...
0
votes
2answers
301 views

ERROR 000358 When trying to select by attribute using “IS NULL” query

I am trying to select a layer by attribute (field is null) using a stand alone python script. #Select layer by attribute to find any null values arcpy.AddFieldDelimiters(mayIntLyr, "...