This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I set up a workflow to audit a Tableau .twb file. I got the idea after reading this post but found that that macro didn't quite get me the output I was looking for. Being new to XML and RegEx, this current version took me quite a few brain cycles and I suspect there are multiple ways to improve it, which is why I'm attaching it here. It works, but there may be ways to arrive at the same (or better) results with fewer or more robust/elegant steps. :-)
What it does:
Reads in a .twb file
Identifies all fields used in the workbook
Cycles each calculated field through an iterative macro that replaces generic field name references like [Calculation_0021112080235996] with the actual field name, which makes for much easier reading and auditing.
Joins the fields with a list of all worksheets that use them
Outputs the data to a TDE for exploration
What it doesn't do (yet):
I can't figure out how to identify fields in the XML that are only associated to a worksheet because of an Action filter remnant. This isn't a huge deal, but I've noticed that some fields are linked to a worksheet simply because at one point an action filter with that field was applied to that sheet and that action filter remained on the filter shelf.
Process more than one .twb file (so that I can check across workbooks whether the same fields and calculations are used). I suspect this is just a matter of turning this into a macro that leverages a Directory tool to pull in all .twb files in a particular folder. That, or an iterative macro that allows you to specify exactly which .twb files you want to feed in.
If this module works for as-is, feel free to use it. If there are things I can do to it to make it run better/easier, I'm open to all feedback. :-)
I am also interested in doing this for my workbooks. Can we include the dashboard name and the associated workb sheets. I see currently you are joining with worksheets. I think it would be good if you can get the dashboard name.
Can we get the table names and SQL Query also added to the workflow if that is something posisble to make it useful.
Thanks for the note...yes, including dashboard names is something I am thinking of adding now that I've got the basic elements down. :-) Regarding SQL and Table Names, I'll need to experiment with the XML against a workbook that uses a live database connection...none of ours do, so I don't have any firsthand experience with that.
I'm attaching a slightly modified version to what I published earlier...I added a few steps to deal with workbooks that are missing key fields like column captions etc. This definitely remains a work in progress as I get more feedback. :-)
I went ahead and added the server connection details extraction from XML- serverdetails , user name ,port , etc - done
Removing the duplicate columns / Joined the columns based on data source name and column name ,
Table Names/Custom SQL when directly connected from tableau - done
if we have any relationship/joins defined ( This is still a question mark on how to parse the nested XML).
I was trying to parse the dashboard//worksheet relation but still haven't found the way as it is Nested XML and need to find out the names from Zones elements.( This is still a question mark on how to parse the nested XML).
Hi @mohsin - thanks for the feedback. Glad you found this helpful. I've actually (finally) written a blog post about the steps I took to create the workflow, which you might find useful as well. I also managed to turn it into a batch macro so that you can feed in multiple workbooks at once. :-)