Member-only story
3 Ways to Use Index() in Tableau
index() function use case

In tableau, index()
function is one of the most important function. Let’s learn about the 3 use cases of index()
function in this article.
- How to create a well-formatted tabular data view in tableau using
index()
function? - How to de-identify any column names using
index()
function? - How to create Top-N / Bottom N filter using
index()
function?
1. How to create a well-formatted tabular data view in tableau using index() function?
In tableau when we create a text table, we will get merged cells.

Here view breaks down by Category and Subcategory. But if you want to have an individual row for each record, it can be done by using index()
function.
Create a calculated field:
index()
Now convert this calculated field index to discrete. Now place this in the first position on the rows shelf.

Now we get an individual row for each record. You can download my workbook from here.
2. How to de-identify subcategories using the index() function?
Suppose we have a use case that has to hide the subcategories name in our view.
What needs to be done?
- If we select a subcategory in the filter, then that subcategory name alone should be displayed in the view. The remaining other subcategories should be displayed as Product 1, Product 2, etc. The remaining subcategories should be deidentified.
