Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [select-by-attribute]

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

0
votes
0answers
14 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
45 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
23 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
35 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 ...
1
vote
1answer
24 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
25 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
21 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
45 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
71 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
51 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
34 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
42 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
46 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
25 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
48 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
252 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
0answers
23 views

Select Multiple Records Based on Key From One Record Match

I have been trying various expressions in the "select by expression" dialog. I have a 500,000 record point shapefile with a ID column and attribute column, and others but let's keep this simple. This ...
0
votes
1answer
26 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
27 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
28 views

Cannot find results of MakeFeatureLayer, cannot use SelectFeatureByAttribute

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
43 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 ...
4
votes
1answer
46 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
40 views

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

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
44 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
86 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
54 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
23 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
26 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
12 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
63 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
41 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
33 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
276 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
77 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
68 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
92 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
65 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
23 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
0answers
28 views

How to select features by attribute in a feature class that match a common field in another feature class?

I have two feature classes: 1)ROADS 2)POI (points of interest along the road) They share a common field that contains the road name (both titled "NAME"). I'm wanting to select the features in ...
0
votes
2answers
81 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, "...
0
votes
1answer
26 views

Subset a shapefile that excludes certain field values by using NOT in Select by Attribute where clause

I am using ArcPy 2.7 to subset a shapefile. I am trying to use arcpy.Select_analysis to exclude certain features from a shapefile (idle fields denoted as 1401 in the field 'Crop_Type'. my 'Crop_Type' ...
1
vote
1answer
195 views

Select feature by id in QGIS using Python

I have a ComboBox shows feature ids of selected features in a layer. I am trying to select one feature using ids in ComboBox currentIndex. I used setSelectedFeature(), but it didn't worked.I can't ...
1
vote
1answer
29 views

Blank attribute table after applying filter in QGIS?

I am completely new to QGIS and am looking for help with filtering OpenStreetMap data. When I applied a filter to the vector layer using the clause "building" is not null and test it, prompt shows me ...
2
votes
1answer
28 views

Select by character limit

I'm using the select by attributes to find unique values that I am copy pasting from a spreedsheet. EX "jobnumber" = 1111116 OR "jobnumber" = 2222245 OR "jobnumber" = 5555655 .. etc The problem is ...
1
vote
1answer
26 views

Filtering data in ArcGIS ModelBuilder?

I am not very experienced with the ModelBuilder and am new to ArcGIS Desktop. I want to use the ModelBuilder to select data from a polygon feature dataset in a first step. The dataset represents the ...
0
votes
0answers
13 views

Finding STW easements with no features in STW polygon in ArcGIS Pro?

I have county data for Storm Water Management easements and then have county data regarding STW features. I am trying to figure out how to create a layer of the STW easements within the county that DO ...
2
votes
2answers
48 views

Selecting a very Large Number of Column Rows based on a comma separated list of numbers

I have managed to do a lot of work regarding point data in the wrong projection, I forgot to change CRS from user 1000005 to BNG before I saved the layer as BNG so now it thinks it is in BNG only it ...
1
vote
2answers
185 views

Select Layer By Attribute Python Script Tool?

I'm trying to script another Select by Attributes tool. I want to be able to find a specific building using a field and zoom in to the location. However, my tool needs to allow a user to input any ...
2
votes
1answer
47 views

Selecting polygon features that are not fully contained against neighbors in QGIS?

In QGIS what would be the best method to select features that are not fully contained against it's neighbours? For example I want to select local authorities that have a coastline so in the example ...
2
votes
2answers
147 views

How to select rows with highest value per group?

I have a .DBF file that contains the number of establishments for each major industry in every county in Florida. I would like to select each of the industries with the largest number of ...