Skip to content
Geoscience.blogYour Compass for Earth's Wonders & Outdoor Adventures
on December 26, 2022

Selecting multiple values with Select by Attributes in ArcGIS Desktop?

Hiking & Activities

Selecting 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

  • Peek at the Attribute Table: In ArcMap, crack open the attribute table of the layer you’re interested in .
  • Summon Select By Attributes: Click that Table Options button and choose Select By Attributes .
  • Craft Your Expression: Double-click the field you want to query . Type IN after the field name, and then select the parentheses icon () .
  • List Your Values: Inside those parentheses, punch in your values, separating them with commas . Remember those single quotes for text values!
  • Double-Check Your Work: Hit that Verify button to make sure your SQL is happy .
  • Make It Happen: Click Apply to run the selection and see the magic happen on your map . Then, click Close to tidy up .
  • 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!

    You may also like

    Field Gear Repair: Your Ultimate Guide to Fixing Tears On The Go

    Outdoor Knife Sharpening: Your Ultimate Guide to a Razor-Sharp Edge

    Don’t Get Lost: How to Care for Your Compass & Test its Accuracy

    Disclaimer

    Our goal is to help you find the best products. When you click on a link to Amazon and make a purchase, we may earn a small commission at no extra cost to you. This helps support our work and allows us to continue creating honest, in-depth reviews. Thank you for your support!

    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

    • Kelty Redwing 50: A Modern Take on a Classic Pack (Review)
    • Deuter Streamer Thermo Bag 3 0 – Is It Worth Buying?
    • Stvyukl Graceful Backpack Crossbody Shoulder – Tested and Reviewed
    • Powered Removable Outdoor Fishing Charging – Tested and Reviewed
    • Nike 3 Brand Clear Backpack: Is This the Functional Fashion Statement You Need?
    • Started Harmless Birthday Keychain keychain – Honest Review
    • Water Shoes Barefoot Steampunk Hiking – Buying Guide
    • Dakine 10004335 365 BACKPACK 28L – Is It Worth Buying?
    • Does Walmart Sell Training Wheels? Let’s Break it Down.
    • Osprey Daylite Commuter: Is This Your Next Go-To Pack?
    • JEKYQ Water Shoes Quick Dry Floating – Is It Worth Buying?
    • Giants Take the Bay: A More Human Look Back at the 2019 Bay Bridge Series
    • Siamese Drinking Backpack Travel Daypack – Is It Worth Buying?
    • Print Patterned Outdoor Double Layered Fisherman – Is It Worth Buying?

    Categories

    • English
    • Deutsch
    • Français

    Copyright Geoscience.blog 2025 | Theme by ThemeinProgress | Proudly powered by WordPress

    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
    Do not sell my personal information.
    Cookie SettingsAccept
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    SAVE & ACCEPT