1 Reply Latest reply on Apr 8, 2016 4:49 PM by diego.medrano

    Tableau Hack: How to have a Dynamic Date Parameter in Tableau

    Andrew Buttigieg

      One of my pet peeves in Tableau is that you cannot have Dynamic Parameters, that is parameters that can be set to a calculation to determine its value at runtime. A common requirement here I get is to have a dynamic date range (e.g. Using the last whole 12 Months, so if today is 15 March 2016, then the range needs to be 1 March 2015 - 29 Feb 2016).

       

      In my hack, I add two parameters to the tableau workbook ([Start Date] and [End Date]), use that to filter the data, and deploy it to Tableau Server.

      I then have a scheduled PowerShell script that uses the Tableau tabcmd command line utility. At a high level I:

      1. Use tabcmd to download the workbook from the server
      2. Do a text find an replace on the downloaded workbook (replacing the old date range with the new date range)
      3. Use tabcmd to publish the updated workbook back to the server

      This allows for a default date range, that is updated on a schedule (monthly in my case, but can be daily, weekly, etc), plus allows the users to change the date range interactively to suite their needs.

       

      Full details and code available on my blog:

      Tableau Hack: How to have a Dynamic Date Parameter in Tableau? - Buttigieg.org

       

      I hope this helps some people work around the lack of dynamic parameters