Why Vizioneer?

My photo
Atlanta, Georgia, United States
The "Vizioneer" comes from mashing two words that have shaped my world for most of my adult life - Engineer and [data] Visualizations (or Vizes to those who know what's up). Graduating from first from Oglethorpe University in Atlanta, followed by Georgia Tech with my Bachelors and Masters in Civil Engineering, all of which taught me to think through anything and everything - problem solving, "engineering" solutions, teaching to the "ah ha" moments - is what I love to do. In 2010 that investigative, engineering mindset intersected a job change and a plunge into the world of Data Analysis. In the search for the next great thing I stumbled on to a data visualization and dashboarding product called Tableau software and things just took off. So now I guess you could call me that engineer with the sweet data visualizations - or just "The Vizioneer" :)

In 2013, I joined the incredible team at Slalom, focusing on Tableau and it's been an amazing experience. Recently in 2014, I was honored and humbled to receive Tableau's highest recognition of being named a Tableau Zen Master. Follow along to see what happens next :)

Monday, October 7, 2013

Tableau and Auto Save - Finally a Solution!

Update 10/13/2015:
I've been asked a couple times if this still works in Tableau 9.1.  It does!  You can always tell if the autosave is working by opening up a new workbook in Tableau and after your set period of time, Tableau will ask you if you want to save it.  As always, let me know if you run into any issues.  Many thanks!

Update 5/27/2015:
I've been asked a couple times if this still works in Tableau 9.0.  It does!  You can always tell if the autosave is working by opening up a new workbook in Tableau and after your set period of time, Tableau will ask you if you want to save it.  As always, let me know if you run into any issues.  Many thanks!

Update 1/7/2015:
So it turns out that I am not a programmer J. One of the things that I found annoying over the last year of using the Tableau Auto-Save hack is the fact that it took up a considerable amount of CPU (10%-15% of my i7 16 Gb laptop) even though the amount of RAM (less than 1 Mb) was incredibly small. Over the break I dug in to see if I could find a solution.  As it turns out running an infinite loop, which was part of the original code, and running it every millisecond (which I believe is what I coded) is a bad idea for performance.  Who would have guessed?  Looking back had I been little more thoughtful on the part of the code where Tableau is not the active window I would’ve seen that the logic would have literally been constantly checking to see when Tableau regained its status as the “active window”.  Thus I have changed the code and it works incredibly better (>0.1% CPU) so wanted to make sure that everybody could make the changes as well. So without further ado here are the new and improved codes for Tableau Desktop v8.2 and v8.1 (code for each will save the workbook every two minutes (120,000 milliseconds) and will check to see if tableau is the active window every 10 seconds (10,000 milliseconds)) :
v9.1,9.0,8.3 and 8.2
Tableau82:
IfWinActive ahk_class Qt5QWindowIcon
{
Send ^s
Sleep 120000
Goto, Tableau82
}
else
{
Sleep 10000
Goto, Tableau82
}

v8.1
Tableau81:
IfWinActive ahk_class TableauMfcMainWindow
{
Send ^s
Sleep 120000
Goto, Tableau81
}
else
{
Sleep 10000
Goto, Tableau81

}

Happy Auto-Saving!

Update 7/11/2014:
The code for Tableau Desktop v8.2 is below.  Again, if you're like me and you can't make a clean break from 8.1 to 8.2 (Tableau Server not ready to upgrade), you can run both scripts at the same time.  Maybe we'll see autosave in v9.0?  Only time will tell!

Updated 12/16/13:
I've just discover that the fix below doesn't work on Tableau v8.1!  The previous fix works for v8.0, but as it turns out that the 'ahk_class' for the window in v8.1 changed with the upgrade.  The new 'ahk_class' for v8.1 is  'TableauMfcMainWindow'. Therefore, depending on which version of Tableau Desktop you're using you'll need to either change/add an additional script.  As I'll be doing work for clients on both versions, I'll just run two scripts - one for v8.0 and one for v8.1.  For reference, they're both listed below and I'll update the blog contents to show the correct script for v8.1:

v8.2
Loop
IfWinActive ahk_class Qt5QWindowIcon
{
Send ^s
Sleep 300000

}

v8.1
Loop
IfWinActive ahk_class TableauMfcMainWindow
{
Send ^s
Sleep 300000

}

v8.0
Loop 
IfWinActive ahk_class TableauMainWindow
{
Send ^s 
Sleep 300000  
}

Updated 12/11/2013:
It was noted in the comments below and I had seen the same issue - This fix was a little too comprehensive.  It was attempting to save any document that had the word 'Tableau' in the title - including webpages, word documents, etc....  I have now fixed that issue by changing the second line of code to 'IfWinActive ahk_class TableauMainWindow'.  This should fix any issues you may have had.  Many thanks!



I have to confess – I love Tableau.  I’m pretty sure I can make anything and everything in to a dashboard, and that the world will be a better place once I do.  So if you ask me what I think of the software, 99% of the time you will get a glowing endorsement from me.  However… the other 1% of the time will likely be the result of something like what happened last Friday.

Something that rears its head every so often is the fact that Tableau doesn't have any form of auto save. None. Nothing.  So every once in a while, during extremely focused dev time, I can go hours before thinking about saving my work.  And normally it’s not a problem.  Normally I’ll just save when I’m finished.  But every so often, typically just as I’m wrapping everything up, some bug gets lose and I crash… and burn, I am left having to answer the age old question – “why do bad things happen to good dashboards?”

I lost about two hours of work on Friday and as this has happened before I decided that it would never happen again.  And my friends, I have good news. 

I have found a solution.  Check it out:

The first thing you need is a lovely piece of third party software called AutoHotKey.  AutoHotKey allows you to write macros of all types that are totally customizable.  We are going to use it to write a very simple script that will automatically save your Tableau workbook every five minutes as you work on it J.




Download and install.

Fire it up and you’ll see that it comes with a pre-canned script (typically saved in your ‘My Documents’ folder’).

Open up Notepad and paste the following text:

Loop  ;Do this forever
IfWinActive ahk_class TableauMfcMainWindow  ;If my active window is Tableau, then….
{
Send ^s ;Hit Ctrl+s (Save)
Sleep 300000  ;Do this every 300,000 milliseconds (aka - 300 seconds, bak - 5 minutes – this is totally changeable)

}
















Go to File>>Save as
Select ‘Save as type’=All Files



Save it as ‘Save Tableau 5 min.ahk’ (make sure you specify to save it as an .ahk (AutoHotKey file)).  Now, if you double click the file you will see a little icon on the toolbar tray showing that the macro is up and running.



Now, go to the file’s location and create a shortcut.



Save that shortcut into your start up folder. 
(On Windows 8 it’s at: C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup)



That’s it!

Now, starting from the time your computer boots up, while you’re running Tableau, your active workbook will save every 5 min and you won’t even notice it (all least not after you’ve given it a file name).  But check your workbook repository for the time modified for the file and you’ll notice that it’s updating automatically and always within the last five minutes.

I hope you find this helpful!  If you do, please let me know in the comments below.

Many thanks –

Nelson

36 comments:

  1. Great tip. I'll definitely need to try this out. Thanks for sharing.

    ReplyDelete
  2. This is incredibly helpful! Nelson thank you so much.

    ReplyDelete
  3. you will lose your undo's with each save. if you want to keep that ability for infinite undo's, then this defeats that.

    ReplyDelete
    Replies
    1. That's true and a good point. But the piece of mind this provides makes it feel like a decent trade off. Good point though and something to be aware of.

      Delete
    2. a compromise might be auto-save at 30 minute intervals? a balancing act for sure

      Delete
    3. I have to say that I haven't experienced losing the ability to undo after a save (my experience so far). I'm running v8.0.4 on Windows 8. If you guys who are experiencing this issue could provide some more details that would be awesome. Many thanks1

      Delete
  4. A clarification... The UNDO works after the autosave. (at least it does for me (-;)... IF you lose a session and have to grab the autosaved file, then THAT session has no UNDO available at the start of the session - you start at where the last autosave left off and you cannot go back... DO you guys actually lose the UNDO after an autosave, even if you are still in the original session???

    ReplyDelete
    Replies
    1. Chuck - I'm seeing the same thing. I'm not having any issues with Undo after autosave, which is awesome! It's an even better solution than we thought!

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
  6. HI Nelson, this is great! Maybe a solution for the Undo would be to save it with a different name, adding some Version number or the date to the filename. You'll have several files, but storage is almost free and you can go back to a previous version.

    Do you know if this is possible using AHK?

    ReplyDelete
  7. published in #4 - tableau weekly -- http://tableauweekly.com

    ReplyDelete
  8. I'm noticing something odd with the script. More than likely, it's something I'm doing wrong.

    Anyway, what is happening to me is that I'll have Tableau up and running. However, I'll have my focus on say Firefox as I'm reading up on something. The script runs and will try to do a save within Firefox rather than in Tableau.

    However, I noticed the script works great as long as you have "focus" on Tableau. So, maybe the script needs to be tweaked or maybe I'm just doing something wrong.

    Thanks again for the script!

    ReplyDelete
    Replies
    1. Lee -
      Great catch. I noticed the same thing too. What's happening is that the script is trying to save any type of file that contains the word 'Tableau' in it's title. After a little digging, I just found a fix and reposted the blog. Here's the text of the update:

      It was noted in the comments below and I had seen the same issue - This fix was a little too comprehensive. It was attempting to save any document that had the word 'Tableau' in the title - including webpages, word documents, etc.... I have now fixed that issue by changing the second line of code to 'IfWinActive ahk_class TableauMainWindow'. This should fix any issues you may have had. Many thanks!

      Delete
  9. I want to thank everyone for their comments on the Tableau Auto-Save Hack.

    There was an issue that you've probably noticed. This fix was a little too comprehensive. It was attempting to save any document that had the word 'Tableau' in the title - including webpages, word documents, etc.... I have now fixed that issue by changing the second line of code to 'IfWinActive ahk_class TableauMainWindow'. This should fix any issues you may have had. The blog post is now updated as well. Many thanks!

    ReplyDelete
  10. Hello everyone -
    Sorry to have to do this again, but it turns out the previous fix I posted last week only works for Tableau Desktop v8.0. I've added the slight modification needed to make it work for v8.1 so please come check it out. If you're like me and using both versions for different projects, just run two scripts at the same time (but don't forget to add them both to your 'Startup' folder!). Sorry for the multiple fixes, but we should be good now. Many thanks!

    ReplyDelete
  11. Thanks for this, it seems to be working fine. I did notice that it does only save when the window is active. Worst case, I lose 5min of work. Better than the 5 hrs I lost today! Tks!

    ReplyDelete
    Replies
    1. LeadLearner -
      That's correct, it only works when Tableau is the active window as it's simply pressing Ctrl+s in the background for you - and that would only save the file if you were in Tableau. It's a hack, but as you said it's better than nothing! Happy New Year!

      Delete
  12. Thanks! Nelson. I'm already a AHK fan, so implementing this was easy!

    ReplyDelete
  13. This has been working great for me - thanks! I just noticed one annoyance after I upgraded from 8.1 to 8.1.4 (and now 8.1.5). The warning that pops up when you save a workbook with remote connections used to have a "Do not show again" checkbox that I selected in 8.1. This allowed autosave to work without any input from me when I was using data on the server. After upgrading to 8.1.4, I've noticed there is no option to turn off the remote connections warning and I have to okay the save each time. I can deal with this, but I'm wondering if there's a setting I could modify to turn off the warning so autosave can do its thing uninterrupted.

    ReplyDelete
    Replies
    1. Jim -
      I just upgraded to 8.1.5 but I haven't seen this yet. I'll be on the look out for it. In the meantime, send me a screenshot so I can see it, if you don't mind. Many thanks for the feedback!

      Delete
    2. Nelson,
      Here's a screenshot of the remote connections dialog box: http://imgur.com/8zW5xWR
      In the past, the checkbox to not show this again was in the lower left.
      Thanks again,
      Jim

      Delete
  14. Thanks for sharing this great tip!

    ReplyDelete
    Replies
    1. Ella - You're very welcome. Glad it was helpful!

      Delete
  15. Excellent tip! works beautifully. Thanks Nelson!

    ReplyDelete
  16. Hello
    Is there a solution for Tableau 9.0 ?
    Thanks

    Stefano

    ReplyDelete
    Replies
    1. From my own testing, I believe 9.0 works the same as 8.2, but let me know if you notice that it's not working in 9.0 and I can walk you through the troubleshooting. Many thanks-
      Nelson

      Delete
    2. Hi Nelson, many thanks. I've followed the steps but every time I open the file I get the following error: Error the target label does not exist. Specifically Tableau82. I'm running 9.1, and I've tried replacing Tableau82 with tableau91 to no avail

      Delete
  17. I'm guessing this won't work in Mac? Just lost 2 hours of work thanks to Tableau's lack of Autosave :(

    ReplyDelete
    Replies
    1. Sorry Paul -
      I wish there was something for Mac to do this. To my knowledge there's not, but if you ever go out and find anything, please let me know. I'd love to include it here.

      Sorry about the crash!

      Delete
  18. Hi Nelson, many thanks. I've followed the steps but every time I open the file I get the following error: Error the target label does not exist. Specifically Tableau82. I'm running 9.1, and I've tried replacing Tableau82 with Tableau91 to no avail

    ReplyDelete
    Replies
    1. Answered my own question. You need to copy the entire script provided, including the opening "Tableau82:" (doh!)

      Delete
  19. I was wondering if this worked with Tableau 10.1?

    ReplyDelete
  20. Trying to find the Ultimate Dating Site? Join and find your perfect match.

    ReplyDelete