This week’s #WorkoutWednesday from Luke Stanke looked at how to page up and down through through a set of results (City, State combinations in this case) such that you don’t need to have a scrollbar on the page.
A concatenation of the City and State (the State Codes were provided by Luke in the challenge page):
Some Max LOD calculations, which are added to their respective measure axes as reference lines, to effectively fix the axes of each measure, so they don’t move around as you move through the pages:
As profit could also be negative, this required a negative version of the Max Profit calc, which was: –[Max Profit]
With the reference lines in place (dashed purple lines), below is the initial view. You can see that the bars don’t fill the full width of their respective columns due the reference lines. I also have an INDEX() on Rows, which is used in an upcoming page filter calc. The index starts at 21, so this is “page 2” of the results (with 10 rows per page):
Page Number and Filter
To calculate the page of results I borrowed this calculation from Luke’s Tableau tips talk from TC18 (Tableau Conference 2018).
I then used this page calculation in another calculation to produce the “From – To” format required for the filter:
This calculation is made up of a concatenation of 3 parts that when put together result in the values used in the filter (snippet below):
Dashboard and Headers
For the headers I used text boxes with a triangle shape in the text and put all three of these, along with the Page Filter, into a horizontal container:
Some final formatting and that was week 9 done. Another great #WorkoutWednesday challenge.