Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
35 views

Selecting max value in SQL query from Extract by Attributes?

I currently have a raster that has 3 columns in the attribute table: OBJECTID, Value, and Count. As part of ModelBuilder, I am running this raster through the Extract by Attributes tool. The Extract ...
1
vote
1answer
26 views

Selection using wildcards [closed]

How can I use wildcards (*) in the ArcGIS Query Builder? It cannot refine my work in Select By Attribute function. 'AA03-FE-P006R' 'AA03-FE-P007R' 'AA03-FE-P006L' Right (Asset_Code,1) = 'L' This ...
0
votes
0answers
65 views

Speeding up SelectbyLocation?

I have the following code in Python for ArcMap to first select a property polygon and then with this selection to select all wastewater sections which pass through or are within this polygon. In the ...
0
votes
1answer
31 views

Writing where_clause to Select Layer By Attribute for Python Add-in?

I have an add-in script for a toolbox in ArcMap that lets a user select a data frame, a layer within it, a field from the layer, an operator (= , > , <, etc.), and a value from the field. I'm ...
1
vote
0answers
20 views

Executing Select Layer By Attribute in Python Add-in Toolbar (ArcMap)

I'm having trouble with the button class of my code: class OKButton(object): """Implementation for ok.button (Button)""" def __init__(self): self.enabled = True self.checked = False def ...
0
votes
1answer
20 views

Select By Attribute - Get Parameter as Text - User input SQL ArcPy

I am trying to create a script that will search for suitable site locations. I want to let the user input an area size (e.g. >20) to be searched but each time I run the script it comes up as Error ...
-1
votes
1answer
22 views

Select by using ArcPy? [closed]

From the below table: If number of ID_T's counts is more than 2 then, I have to select, same ID_T but DIST value vary of minimum 10 meters
1
vote
1answer
39 views

Select by attribute not working [closed]

I created a point shapefile by converting a raster into points. The default fields generated were FID, Shape, POINT_ID, and GRID_CODE. I added two new fields "X_location" and "Y_location". I ...
0
votes
1answer
39 views

Trying to use a SelectByAttribute_mangement after I made the XY Event layer

I imported a CSV file using the MakeXYEventLayer_management and trying to use the SelectlayerByAttribute_management function, but I am getting error message saying on "Object ID(OID)" is present.. Is ...
4
votes
1answer
83 views

Selecting and updating attribute values using Python console in QGIS?

I am working with Landusefc and Class columns (ref table). What I want is: Selecting all water from "Class" and giving a value say '8' in the "Landusefc" column for these selected features. Table ...
0
votes
1answer
26 views

SQL wildcard for Field Name?

I'm wondering if there's anyway to use a wildcard character in a field name. Like using ["Species_%" = 'Hemlock'] instead of ["Species_1" = 'Hemlock' OR "Species_2" = 'Hemlock' ...]. I tried the way ...
0
votes
2answers
62 views

ArcGIS 10.5 Python toolbox problem SelectLayerByAttributeERROR 000358: Invalid expression Failed to execute

I am trying to create a .pyt that find and select an object in an specific layer but I have a problem. I'm working on the Desktop version 10.5 and actually the code is this one: def getParameterInfo(...
0
votes
1answer
32 views

Select by attribute with field equal to element of vector in ArcPy?

I am trying to select by an attribute with a condition that field equals to an element of a vector. I use a for loop but could not get the right expression for this condition. Here are my codes. ...
-1
votes
1answer
48 views

How to select attribute specific values? [closed]

I have table like I need to select if R_no values is more than two same values and in ANGLE select first three numbers common and more than three attributes is same Finally I want to select like ...
0
votes
1answer
27 views

Counting attribute value based on location using ArcGIS Pro?

I have a school district polygon divided up by neighborhood, and I am trying to determine the number of students from each grade per neighborhood. The student point file contains an attribute with ...
1
vote
1answer
49 views

Select Contour by Length

I am a real beginner with QGIS 2.8. I am able to generate a contour map from a raster DEM, but the contour map is very 'busy' because the land form is pretty flat. There are lots of short contour ...
0
votes
1answer
31 views

Using keyword in SelectByAttribute expression?

I've used SearchCursor to return the single value of a record (8 digit number) for row in arcpy.da.SearchCursor(table, ['PID']): if row[0] is not None: ID = row[0] break Now I would like ...
1
vote
0answers
14 views

Select by attributes ModelBuilder - text string partial values for parameter

I have a feature class of suburbs that I want to do a select by attribute on the Locality (=suburb names) field, passing a user input string parameter to selection expression. I have the query ...
1
vote
1answer
121 views

Getting particular feature using expression in PyQGIS? [closed]

How to get a particular feature using an expression in PyQGIS? For example, there are 100 houses (with 100 entries in Attributes Table). I want to get only one house with field name ("name"=="John's ...
3
votes
1answer
17 views

Calculate a field using text from another field separated with comma

I have an address field containing the following text: "64,ramkoti,hyderabad,500070" I need to copy hyderabad to another field. What would be the code used in the field calculator tool to achieve ...
0
votes
1answer
50 views

Getting ERROR 000840 from arcpy.SelectLayerByAttribute_management?

I am trying to select layer by attribute and for that, I am using arcpy.SelectLayerByAttribute_management function . My command is as follows: arcpy.SelectLayerByAttribute_management(union, '...
0
votes
1answer
46 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
34 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
27 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
36 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
51 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
53 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
31 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
23 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
41 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
49 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
24 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
67 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
35 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
61 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
37 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
27 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
42 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
48 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
119 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
70 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
44 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
50 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
56 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
31 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
51 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
359 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
27 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)' ...