Selecting multiple values with Select by Attributes in ArcGIS Desktop?
Hiking & ActivitiesSelecting Multiple Values with Select By Attributes in ArcGIS Desktop: A Human’s Guide
So, you’re diving into the world of GIS with ArcGIS Desktop and need to wrangle your data, right? One of the first things you’ll want to master is selecting features based on what they are – their attributes. ArcGIS Desktop has a handy tool called “Select By Attributes” that lets you do just that using SQL expressions. Picking one value is easy, but what about grabbing a bunch at once? That’s where things get a little trickier, but don’t worry, I’m here to walk you through it. Just a heads up, though: ArcGIS Desktop is getting a bit long in the tooth and will be retired March 1, 2026. Esri is nudging everyone towards ArcGIS Pro, so keep that in mind.
Getting Cozy with “Select By Attributes”
Think of “Select By Attributes” as your data-filtering wizard. It lets you build SQL queries to pinpoint exactly the features you need . You can find it under Selection > Select By Attributes . You pick your target layer, decide how you want to select things (new selection, add to what you’ve got, etc.), and then whip up your query .
The “IN” Operator: Your New Best Friend
When you need to select multiple values, the “IN” operator is your absolute best bet. It’s clean, it’s efficient, and it gets the job done. Basically, it lets you give a list of acceptable values for a field, and it’ll grab anything that matches.
Here’s the basic idea:
fieldname IN (‘value1’, ‘value2’, ‘value3’) — for text fields
or
fieldname IN (value1, value2, value3) — if you’re dealing with numbers
Let’s say you’re working with a layer of cities, and you want to select New York, Los Angeles, and Chicago. If the city names are in a field called “CityName”, your expression would look like this:
“CityName” IN (‘New York’, ‘Los Angeles’, ‘Chicago’)
Simple, right? And if you’re dealing with parcel data and need to grab parcels with IDs 14, 15, and 16 (stored in a field called “ParcelID”), you’d use:
“ParcelID” IN (14, 15, 16)
Walkthrough: “IN” Operator in Action
Other Ways (But Why Bother?)
Okay, there are other ways to do this, but trust me, they’re not as pretty. You could use a bunch of “OR” statements, but it gets messy fast.
Like this:
“CityName” = ‘New York’ OR “CityName” = ‘Los Angeles’ OR “CityName” = ‘Chicago’
See how repetitive that is? Stick with “IN”.
Things to Keep in Mind
- Data Types Matter: Make sure your values match the field type. Text needs quotes, numbers don’t.
- Nulls are Tricky: If you need to include empty (null) values, it’s fieldname IN (NULL, ‘value1’, ‘value2’). But heads up, some databases might need a slightly different approach.
- SQL Has Limits: SQL queries can only be so long. If you’re selecting a ton of values, you might hit a limit. Consider breaking it up into smaller chunks.
- Not Everyone Plays Nice: The “IN” operator is pretty common, but some older data formats (like shapefiles) might not support it. Test it out first!
Pro Tips for Smooth Sailing
- “Get Unique Values” is Your Friend: Use that “Get Unique Values” button to see all the possible values in a field. It’ll save you from typos and headaches.
- Save Your Queries: If you find yourself using the same selections over and over, save the expression!
- Verify, Verify, Verify: Always double-check your SQL before running it.
- Field Names, Not Aliases: Stick to the actual field names in your expressions, even if you’ve given them friendlier aliases.
Mastering “Select By Attributes” and the “IN” operator is a game-changer for data exploration in ArcGIS Desktop. Keep those limitations in mind, double-check your work, and you’ll be selecting like a pro in no time. And don’t forget to think about making the jump to ArcGIS Pro!
Disclaimer
Categories
- Climate & Climate Zones
- Data & Analysis
- Earth Science
- Energy & Resources
- Facts
- General Knowledge & Education
- Geology & Landform
- Hiking & Activities
- Historical Aspects
- Human Impact
- Modeling & Prediction
- Natural Environments
- Outdoor Gear
- Polar & Ice Regions
- Regional Specifics
- Review
- Safety & Hazards
- Software & Programming
- Space & Navigation
- Storage
- Water Bodies
- Weather & Forecasts
- Wildlife & Biology
New Posts
- Decoding the Lines: What You Need to Know About Lane Marking Widths
- Zicac DIY Canvas Backpack: Unleash Your Inner Artist (and Pack Your Laptop!)
- Salomon AERO Glide: A Blogger’s Take on Comfort and Bounce
- Decoding the Road: What Those Pavement and Curb Markings Really Mean
- YUYUFA Multifunctional Backpack: Is This Budget Pack Ready for the Trail?
- Amerileather Mini-Carrier Backpack Review: Style and Function in a Petite Package
- Bradley Wiggins: More Than Just a British Cyclist?
- Review: Big Eye Watermelon Bucket Hat – Is This Fruity Fashion Statement Worth It?
- Bananas Shoulders Backpack Business Weekender – Buying Guide
- Sir Bradley Wiggins: More Than Just a Number – A Cycling Legend’s Story
- Mountains Fanny Pack: Is This the Ultimate Hands-Free Solution?
- GHZWACKJ Water Shoes: Are These Little Chickens Ready to Fly (On Water)?
- Circling the Big Apple: Your Bike Adventure Around Manhattan
- Dakine Women’s Syncline 12L: The Sweet Spot for Trail Rides