Keep it clean
Every now and then, Tableau extracts aren’t refreshed properly. That, in and of itself, isn’t a bad thing. What we’re worried about are the extracts that continue to fail day after day. They consume resources and, most importantly, don’t give a true picture of the data.
Here’s a simple script that queries postgres and grabs the extracts which have failed n times (you can choose your threshold). At a very high level, it does the following:
- Get list of failed extracts (most recent fail date should be the current date)
- Limit to those only above your desired threshold
- Use REST API to pull extracts from Tableau Server
- Do a diff on list and downloaded files and remove only those which are equal
- Archive twb/twbx/tds/tdsx so users can refer to this later
- Delete content from Tableau Server
Taking it a step further
If you have a Log Analytics strategy in place, you can send the output of the script to a file and have the log agent follow it. This will give you and the rest of the Tableau admin team some insight to what is failing (other than what I’ve talked about before).
You can also integrate with Slack in order to notify the user/owner that his/her workbook will be remove until the failure is fixed.