Tableau Tips and Tricks to Make Your Visualisations Stand Out
Today's blog is the first instalment in a monthly series covering some of Tableau's more advanced features that can make your dashboards stand out. Topics will range from this session on continuous buttons to transparent backgrounds and advanced URL usage. Feel free to leave comments with any subjects you would like to see covered in the future.
When creating a multi-dashboard project, many people struggle when trying to move around it effectively. The two common solutions to that issue are to either double click on each button or to un-select the button before pressing it. Having found the wonders of continuous buttons, I thought this would be a good starting place for my series.
If you play around with an old workbook, it's easy to end up with buttons that have already been pressed, as seen in Figure 1. This means that you'd need to un-select this button before moving on, which isn't ideal. A well-known "workaround" is to click twice: first to use the button, then to un-select it. These steps are no longer needed with the use of continuous buttons.
Tableau Tip #1
Use an entirely separate data source for your buttons. This will keep the data tidy and clearly show which sheets are buttons. It will often make the end file smaller as well.
The theory: The principle behind continuous buttons is that, if there are enough buttons, the chances of running into a new one are slim. Every time a button is clicked, Tableau will generate a new button with the next ID number from the list provided. The old button still exists, but it is just filtered out. Having said that, you could still come across a button that has already been pressed, only the chances of this happening are massively reduced.
How to do it: Using a separate data source, set up two columns with the same data in, with an offset of 1. The number of rows doesn't matter too much, but twice as many points as buttons is a good starting point. If you keep on running into already pressed buttons, simply increase the number of rows. I chose to do 139 points, but any number over two will work. Now this data can either be set up within Tableau as a calculation or in your data source. If you are doing it within Tableau, you will need the formula: "IF [ID] >=139 THEN 1 ELSE [ID] + 1 END", where 139 is your number of rows. See figure 2 below for what this should look like.
The next step is to make one (or both) of your ID's into a Dimension because Tableau has different options for filtering with a Measure. Your button can then be built up normally ensuring that your Dimension ID is the one used in the workbook. I have made my button by colouring by number of records and labelling by Increment ID, which I have changed to static text. Feel free to make your button however you like.
After pulling this button onto your dashboard, you can set up your filters as you normally would, but with a few additions. Firstly, tick the "Leave the Filter" option; this makes sure that even when a new button is created only one ID is shown. Secondly, you will need to apply a custom filter. This will be from the ID field to the Increment ID field, creating a new un-selected button for use. Check Figure 3 for how this should look.
Tableau Tip #2
Using the middle mouse button allows you to bring up the selection box without activating any actions that belong to that workbook. This can be very useful to bring up the sheet options for a button.
Now that your buttons are mostly set up, the last stage is to apply the filter to all buttons using this data set. To do this, go to the sheet containing the button and click the drop down arrow by the ID filter. Here you need to apply this filter to "All using this data set" and then your buttons will be completed. Check out figure 4 below to see where this option is. To add a button, make sure you use the same ID field, set up your filter options to "Leave the filter" and map the ID with Increment ID.
If your buttons aren't working, try adding both the ID and Increment ID onto the button, as the one that you need depends on which way around your actions are set up. I hope that this blog has taught you something new and if there are other topics that you would like me to cover just let me know. Below is a demo dashboard which contains continuous buttons as well as some of the other features that I will be demonstrating in the series.