Video | Tableau | Data visualisation | Analytics

The Index ( ) function in Tableau

The index function simply counts rows but there's more to it than meets the eye.

  • INDEX() counts rows and has no arguments; the quickest way to use it is to type it as an ad hoc calculation directly in a shelf
  • Because INDEX() returns as a measure (green) by default, set it to discrete to get clean row numbers as headers rather than a bar chart
  • Use Compute Using and the table calculation partition settings to control whether the count restarts within subcategories or runs down the whole table
  • Wrapping INDEX() inside RANK() reverses the count, letting you number rows from the bottom up
  • A practical date trick: rank an index counting from the bottom, then keep only values 1-6 to always show the most recent six months as data updates

The index function essentially counts rows in a dataset and it can be controlled we using a partition, a concept I cover in this video along with creative ways of using the index function to achieve interesting filtering results.

  • 0:00 Intro
  • 0:21The Index () Function
  • 4:16 Understanding how it all works
  • 9:27 Counting Backwards
  • 13:30 Outro