index() operate use case
index() operate is among the most essential capabilities. Let’s be taught in regards to the 3 use instances of
index() operate on this article.
- Easy methods to create a well-formatted tabular information view in tableau utilizing
- Easy methods to de-identify any column names utilizing
- Easy methods to create High-N / Backside N filter utilizing
In tableau after we create a textual content desk, we’ll get merged cells.
Right here view breaks down by Class and Subcategory. However if you wish to have a person row for every file, it may be accomplished through the use of
Create a calculated subject:
Now convert this calculated subject index to discrete. Now place this within the first place on the rows shelf.
Now we get a person row for every file. You may obtain my workbook from here.
Suppose we’ve got a use case that has to cover the subcategories title in our view.
What must be accomplished?
- If we choose a subcategory within the filter, then that subcategory title alone must be displayed within the view. The remaining different subcategories must be displayed as Product 1, Product 2, and so on. The remaining subcategories must be deidentified.
Now we’ve got to deidentify the sub-category title.
How it may be accomplished?
- Create parameter Subcategory and click on Add values from “Subcategory” variable. After creating the parameter, right-click and choose “Present Parameter”
2. Create a calculated subject to show names for subcategories.
“Product “ + str(index())
For the chosen subcategory alone, it is going to show the precise title. For others, it is going to show names like “Product 1, Product 2.. and so on.
3. Now drag the calculated subject
Consecutive_Numbers to the row shelf.
4. Click on the Subcategory within the row shelf and deselect
5. Now if we choose a selected subcategory like “Storage”. It’ll show the title of that subcategory alone. The remaining it is going to show as “Product 1, Product 2.. and so on.
This has been achieved utilizing
index() operate. My workbook might be downloaded here.
We will simply create a High N filter / Backside N Filter utilizing
Let’s create a bar chart SubCatgeory vs Revenue. I’ve sorted them in descending order.
Let’s add an index as a label for our understanding. I’ve added
index() to the label on the marks card.
Now we’ve got to create a High 5 filter.
Create a calculated subject — High 5 Filter
Now add this High 5 filter to the filter shelf and click on True.
Be certain that, we’ve got sorted the graph in descending order earlier than making use of the filter. If we type the graph in ascending order, it is going to work as the underside 5 filters.
We will reuse this filter for all sheets. That is a simple option to create a High N/Backside N filter.
You may obtain my workbook from here.