A lot of folks are struggling with this issue: imagine that you have to build an extract with millions of rows from your slow databases. You are on your corporate VPN from a hotel room or from a plane. It’s just painful and risky and the extract sorting process will consume a lot of CPU resources on your computer – giving away valuable resources from Flappy Bird and friends. So, what is the solution? Ben Sullins and Peter Juel Jensen suggest to create database views while Russell Christopher using a calculation trick (where you should wait a day for the miracle) to move the initial extract generation to the Tableau Server side. Well, I don’t like these solutions: sometimes you just do not have the rights to create a database view or you need the results ASAP. So, what’s my approach?
These are the steps you should take, I will explain them in details:
- Create an initial extract with 1 sample row
- Edit the twbx file and change the “1” row to “-1”
- Publish to the server and generate it
If you are new to extracts I suggest to read Tom Brown’s excellent article on extracts.
Create an initial extract with 1 sample row:
Open your new datasource and click on “Import some data” or if you have an existing data source just click on “Extract data”.
Now, select top 1 or sample 1 row to refresh the extract.
It should be fast and painless.
Edit the twb(x) file and change the “1” row to “-1”
This is the tricky part. If your workbook is a “Packaged” one, you should rename it to .zip, open it, locate the twb file and open it. If you have already a twb, then just simply open it with an editor.
Locate the extract part and change count=1 to count=-1
Make sure that you save these settings into the twb file. In case you have packaged workbook change back the extension from zip to the original twbx file.
Publish to the server and generate it
Now you should open this edited file with Tableau Desktop, and publish to the Server. After that, go to the data sources and trigger the full extract to refresh. Tableau Server will took all the records (-1 means infinite).
Was that easy? I think so, but if you have a better/different solution, just drop me a line!
Liked this article? Don’t forget to subscribe so you won’t miss any of these!
- Tableau Extensions Addons Introduction: Synchronized Scrollbars - December 2, 2019
- Tableau External Services API: Adding Haskell Expressions as Calculations - November 20, 2019
- Scaling out Tableau Extracts – Building a distributed, multi-node MPP Hyper Cluster - August 11, 2019