As businesses become increasingly data-driven, the importance of real-time data in decision-making has never been more critical. The ability to quickly and easily access up-to-date information can be the difference between success and failure in today’s fast-paced business environment.
Tableau, a leading data visualization and business intelligence tool, has long been known for its easy to use interface to work with data and present it in intuitive, interactive dashboards.
However, even with Tableau’s capabilities, there may be times when you need to refresh the data in your dashboard to ensure that it remains current.
In this article, we’ll explore the benefits of refreshing real-time data in Tableau and show you how to add a custom dashboard button to refresh the data on demand.
Benefits of Refreshing Real-Time Data in Tableau
Refreshing real-time data in Tableau can bring a number of benefits, including:
- Improved accuracy and up-to-date information: Keeping your data current means that the information displayed in your Tableau dashboard is always accurate and relevant. This is especially important when dealing with real-time data, where even small delays can result in out-of-date information.
- Increased efficiency and time savings: Refreshing data manually can be a time-consuming and repetitive process, especially when working with large datasets. Automating the process can help you save time and increase efficiency.
- Enhanced user experience: Providing a dynamic, up-to-date view of your data can improve the user experience for your stakeholders, helping them to make informed decisions faster and more efficiently.
Tableau’s Live Data Quirks
To be able to work with real-time data in Tableau you’ll need to use a live connection to the database as opposed to a data extract. A data extract is a hyper file that stores the data locally or on the Tableau Cloud/Server.
But even with live connections you might not see the most recent data in your view.
Why, you ask?
Tableau has a caching mechanism for the views. While it’s good to have a faster page when viewing a dashboard, you might end up seeing outdated numbers.
Adding a Dashboard Button to Refresh Real-Time Data in Tableau
By default, Tableau provides several options for refreshing views, including a toolbar button and a URL parameter. You can also set Data Freshness Policy for the workbook or change the default cache settings on the Server side.
However, these options can sometimes be insufficient, especially when you need to refresh the data on demand. In these cases, adding a custom dashboard button can be a more flexible and effective solution.
Steps to Add a Custom Button in Tableau
Adding a custom button to your Tableau dashboard is a relatively simple process. To begin, you will need to create a new sheet which will act as a button on your dashboard.
Once you have added your button, you will need to assign it a function. This can be done by going to Dashboard Actions. From here, you can assign the Parameter Action which will act as refresh function on your button.
Once you have assigned the refresh function to your button, you can further customize it by changing the appearance and design of the button. You can change the color, text, and overall design of your button to match the look and feel of your dashboard.
Below is a detailed list of steps you need to follow.
Step 1: Create a Parameter and a Calculated field
The first step is to create a parameter named “Refresh”. To do this, click on the “Create Parameter” button in the “Data” pane, and then configure the following settings:
- Data Type: DateTime
- Allowable values: All
- Current value: can be anything
We also need a calculated field with just the NOW() function like below.
Step 2: Update the Data Source
Next, update your data source to include the “Refresh” parameter. To do this, click on the “Edit Data Source”, and then include the parameter as a comment inside a custom SQL code block:
--<Parameters.Refresh>
SELECT * FROM table
The custom SQL needs to include the parameter to be able to force Tableau to refresh the data. It’s sufficient to place it in a SQL comment.
Step 3: Create a Mock Chart Button
Create a mock chart in a new sheet that will serve as the “Refresh” button. To do this, type MIN(1) in the columns shelf of a bar chart, then add the “NOW()” function to the detail shelf.
Also type in something like “Click to refresh data” on the Label shelf.
This will create a bar chart/button that updates the “Refresh” parameter with the current time every time you click on it.
Step 4: Add Actions to the Dashboard
Finally, add a Parameter Action to your dashboard. You need to go to Dashboard > Actions to set it up.
This action will update the value of the “Refresh” parameter when the user clicks on the mock chart. To do this, click on the “Add Action” dropdown, and then configure the following settings:
- Run Action on: Select
- Source Sheets: Select the mock chart
- Target Parameter: Select the “Refresh” parameter
- Source Field: Select the NOW calculation with no aggregation
Optionally, you could add an action to direct the user to a different view when clicking on the button. This is possible using a GoToSheet Action. To do this, click on the “Add Action” dropdown, and then configure the following settings:
Run Action on: Select
Source Sheets: Select the mock chart
Target Sheets: Select the dashboard you want the user to navigate to
And that’s it! You have now successfully created a data refresh button in Tableau. Your users can now click on the “Refresh data” button to update their visualizations with new data on demand.
Here’s a recording of how it works:
Refresh Button Benefits
A custom button implementation has a number of benefits over the default Tableau options for refreshing real-time data. For one, a custom button can be tailored to the specific needs of your organization and user base, allowing for a more intuitive and user-friendly experience.
Additionally, a custom button allows for greater control over the refresh process, including the frequency and timing of data updates. This can be particularly useful for organizations that work with write-back extensions or require very specific update schedules.
Another benefit of a custom button is that it can be integrated into your existing Tableau dashboard, making it accessible and easily usable for your team. This is in contrast to the default Tableau options, which may require training your users on how to access the refresh function.
With a custom button, users can easily and quickly update their data with the click of a button, ensuring that they are always working with the most up-to-date information.
Considerations for working with big data in Tableau
When working with big data in Tableau, there are a number of important considerations to keep in mind. One of the biggest challenges is the amount of processing power and memory required to effectively analyze and visualize it. This can result in slow performance and long wait times for users.
It is recommended in most cases to use Tableau’s data extracts, to reduce the size and optimize the data that needs to be processed. This can greatly improve the speed and performance of your Tableau dashboard.
Another consideration when working with big data in Tableau is the amount of data that needs to be updated in real-time. With large datasets, the refresh process can take a significant amount of time, which can result in a slow and frustrating experience for users.
To overcome this challenge, it is important to use a custom button implementation for refreshing real-time data. By using a custom button, you have greater control over the refresh process, including the frequency and timing of data updates. This can ensure that the data being displayed in your Tableau dashboard is always up-to-date and accurate, even when working with large datasets.
Additionally, it is important to consider the storage requirements for big data in Tableau. This may require the use of a separate data storage solution, such as a data warehouse or a lake, to ensure that the data is properly stored and managed. By taking these important considerations into account, you can effectively work with big data in Tableau and ensure that your data analysis and visualization process is fast, efficient, and accurate.
Conclusion
In conclusion, adding a custom button for refreshing real-time data in Tableau can greatly enhance the user experience and improve the overall efficiency of your data analysis process.
Whether you work with large datasets or require a very specific update schedule, a custom button implementation provides greater control and accessibility over the refresh process.
By following the steps outlined above, you can easily add a custom button to your Tableau dashboard, ensuring that you and your team are always working with the most up-to-date information.
Highly passionate about data, analysis, visualization, and everything that helps people make informed decisions.
I love what I do! I am working to improve speed in every aspect of my life and that of our clients.
I find comfort in helping people, so if you have a question, give me a shout!
View Comments (2)
Thanks for an interesting blof post
But Tableau now have the functionality to set a specific report to never use the cache, and without any user action required. It is called Data freshness policy
Hey Matz,
Thanks for your input! Consider a use case where the user inputs new data through a write-back extension and wants to refresh the data on demand. Also, you might not want to set the data freshness policy to live for all users (bypassing the cache entirely). There are specific cases where a custom button is a solution. This was actually a request from a customer, so I'm pretty sure it has applicability in real-life situations
Dorian