Indexing records

Indexing creates a separate index file (.inx file) that allows access to the records in an Analytics table in a sequential order rather than a physical order (that is, the raw data order).

Indexing does not physically reorder data in tables. However, when a table’s index is active, the data in the view is reordered in accordance with the order specified by the index, and analytical operations process the data based on this order. If a table has more than one view, all views are subject to an active index.

When an index is active, the word Indexed prefaces the record count in the status bar. For example: Indexed Records: 500.

When the index is inactive, the records in a view revert to their original physical order. Upon opening an Analytics table, any existing indexes are inactive by default.

Note

Sorting records is an alternative to indexing them, and in some situations may be a better choice. For more information, see Should I sort or index?

Indexing and field type

You can index any type of field, including computed fields and ad hoc expressions, regardless of data type.

Indexing on logical fields requires that Include Filters in Field Lists is selected (Tools > Options > Interface).

Multiple indexes for a single table

You can create multiple indexes for a single table, and switch between indexes as required, which can be useful when initially assessing a set of data. Only one index can be active at a time.

Nested indexing

You can index records using one key field, or you can create nested indexing schemes by indexing on multiple key fields (primary key field, secondary key field, and so on).

Nested indexing supports mixing ascending and descending order, and mixing data types, across key fields.

Nested indexing with mixed ascending and descending order

You want to see the largest transaction amounts for each day in an unsorted transaction table. You index the table in ascending order on a date key field, and within each day in descending order on an amount key field.

Date field

(ascending)

Amount field

(descending, nested)

15 Jan 2011

$2300.00

15 Jan 2011

$1200.00

15 Jan 2011

 $600.00

16 Jan 2011

 $900.00

16 Jan 2011

 $100.00

17 Jan 2011

$4700.00

17 Jan 2011

 $900.00

17 Jan 2011

 $500.00

Indexing is restricted to Analytics tables

Indexing is restricted to Analytics tables – that is, tables with a .fil source data file. You can index both local and server-based Analytics tables if they have .fil files.

You cannot index database tables that you connect to using a database profile, because there is no .fil file. Data is read directly from the database. To order data in this situation, you can use a SQL ORDER clause in the Data Definition Wizard while accessing the database.

Indexing required for some Analytics commands

Indexing is a prerequisite for using the Find Literal and Seek Expression options in the Search dialog box when searching Analytics tables. (The options are the equivalent of the FIND and SEEK commands.)

These options are available only if:

  • a table is indexed
  • the index is active
  • the index’s primary key field is a character field indexed in ascending order

The table can have a nested index, but only the primary key field is searched.

Conditional indexes

Indexes can include If, First, Next, and While parameters, in which case they become conditional indexes. Only those records that match the condition are indexed, or are displayed or available for analysis when the conditional index is active.

Steps

Index records

You can index records by one or more key fields in the active table, and use the resulting index to temporarily reorder the records without affecting the underlying physical order of the data.

Activate or deactivate indexes

You can activate an index at the time you create it, or at any time after creating it. Upon opening an Analytics table, any existing indexes are inactive by default.

View index details

You can view the details of an index – that is, the actual syntax of the specific Index command. The command syntax includes the key field(s), and any parameters, filters, or expressions. Index details reveal exactly how a particular index is processing the records in a table.

Maintain indexes

You can copy, rename, or delete an index in the Indexes tab of the Table Properties dialog box. You can also add additional indexes from the same location.

Analytics 14.1 Help