Tabular IQ
Back to Function Index

RECNO()

Overview

RECNO() returns the absolute position of a record within a dataset, regardless of any sorting or filtering applied. This function is useful for tracking record positions, creating sequential numbering, and maintaining record order in operations.

Function Format

RECNO()

Return Value

RECNO() returns a numeric value

Examples


RECNO() = 1                         (first record in the set)
RECNO() = 25                        (25th record in the set)
RECNO() = 100                       (100th record in the set)
RECNO() = 1                         (first record, even after sorting)
RECNO() = 25                        (25th record, even after filtering)

Notes

  • Important behaviors:
    • Returns the absolute position in the dataset
    • No parameters required
    • Position is independent of sorting
    • Position is independent of filtering
    • Starts counting from 1
    • Not available on directly connected external tables
  • Common use cases include:
    • Record tracking
    • Sequential numbering
    • Position-based operations
    • Data validation
    • Record ordering
  • The function can be used in:
    • Record identification
    • Position tracking
    • Order maintenance
    • Data processing
  • This function is often used in combination with other functions for record management and data processing.
  • For relative positions or positions after sorting, consider using ROW_NUMBER() or other window functions.

See Also