Here’s a quick tutorial on how to create a table with pagination. I will be using the superstore data that comes included with Tableau.
To start, let’s look at the data. Let’s say we want to create a table that shows ten order IDs with each of the different profit metrics. Right now the list of Order ID’s is too long and it’s overwhelming.
The first thing we need to do is create a table size parameter. This parameter will determine how many rows our table has.
I named it Table Length, set the Data type to Integer, and then set the current value to 10. For allowable values, I set it as a range from 1 to 25 with a step of one. This doesn’t matter too much and I won’t be displaying this parameter in the final dashboard. But if someone(aka the client) wants to make a change to the table, having this built-in functionality will make it very easy.
Next, we make another parameter. This one is called page and will be used to toggle between pages.
I set the Data type to Integer, Current Value to 1, And then gave it a range from 1-100 with a step of 1. The range is dependant on your data and you can make it as long or as short as you need. In this case, I chose 100 rather arbitrarily.
The final step before we start adding things to the workbook is to create a calculated field to make the actual pages. I named it Pagination.
Using the index function and the two parameters we created earlier, it creates a subset of the list in the table.
Here’s the code so you can just copy it:
INDEX() >= ( [Page] - 1 ) * [Table Length] + 1 AND INDEX() <= [Page] * [Table Length]
Then you just add everything to the workbook.
Drag the Calculated Field into filters and select True. Then right-click on each parameter and select Show Parameter Control. Using the arrows or the input boxes you can adjust the table to your liking.