HOW TO

Select every nth record in a table or feature class

First Published: April 23, 2018
Last Published: June 4, 2026

Summary

To select every nth record in a table, use the Select by Attributes tool with the modulo function (MOD).

This avoids the use of Python scripting and can be input to the Feature Class to Feature Class tool. Extra modifications can be made to start at a particular record, as well. 

Procedure

  1. In ArcGIS Pro in the Map tab, click Select By Attributes.

ArcGIS Pro Map tab

  1. Turn on the SQL Editor, as shown in the next image.

Select By Attributes tool

  1. Use the following formula in the Expression box:
MOD(OBJECTID+2n-x, n) = 0
  • n is the every nth record
  • x is the objectid to start  from

Examples

For every fourth record, starting at OBJECTID = 1:

  • n = 4
  • x = 1

Therefore: 2n-x = 7, and

MOD(OBJECTID+7,4) = 0

Selects records 1, 5, 9, 13, and so forth.

For every third record, starting at OBJECTID = 2:

  • n = 3
  • x = 2
MOD(OBJECTID+4,3) = 0

Selects records 2, 5, 8, 11, and so forth.

result of calculation

Note:
This formula fails for 2n < x.

Article ID: 000016090

Software:
  • ArcGIS Pro

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options