4 Replies Latest reply on Jul 18, 2017 4:58 AM by Henrique Ferraresso

    Data Adjusted to customer's Timezone when being displayed

    Henrique Ferraresso

      Hi folks,

      Does anyone knows if it's possible to adjust the data to customer's timezone?

      For example, when a person did an action on 1 AM EST on Jan 2nd and the customer configured timezone is EST, i shall report this action happened on Jan 2nd, not Jan 1st even if the tableau server is running at PST.

      Also i need to adjust for daylight saving as well.

        • 1. Re: Data Adjusted to customer's Timezone when being displayed
          Tom W

          Will the report be opened in Tableau Desktop or on an instance of Tableau Server?

          Will the report be connected to a live data source or an extract?

          • 2. Re: Data Adjusted to customer's Timezone when being displayed
            Henrique Ferraresso

            Hi Tom W,

             

            It will be opened on instance of Tableau Server.

             

            and the report will be connected to a live data source.

            • 3. Re: Data Adjusted to customer's Timezone when being displayed
              Tom W

              You have a couple of problems here;

               

              1. Getting the timezone of the current user / client

              2. Converting the data to the timezone from (1)

               

              Getting the timezone of the current user / client

              • If you're doing this at client level it would be a bit easier. In other words, if you can assume that a client all use the same timezone, you could set a UTC offset at the client level and store this in the database in a table or in the Tableau report as a parameter or calculated field
              • If you need to do this at user level i.e. the person opening the report, it gets a bit harder. The easiest way would be to give the client a dropdown parameter inside the Tableau report to control their timezone and create a bunch of DATEADD calculations in the report to adjust according to the offset (or pass it through to SQL and handle it in the database). The harder way, would be detecting their timezone - you'd need to write a webpage, embed the tableau server report in that webpage then use the Javascript API to pass the UTC offset through into the report / database to figure out the adjusted time.

               

              Converting the data to the target timezone

              • Once you have an offset for the timezone you can use the DATEADD function in Tableau to convert or the dateadd function in your database. Taking into account daylight savings is tricky, and you should do some reading on how to do that within SQL. In MSSQL you might be able to utilize something like TODATETIMEOFFSET

               

              TLDR: There is no native support for such a conversion inside Tableau, nor is there native support to detect the client timezone.

              1 of 1 people found this helpful
              • 4. Re: Data Adjusted to customer's Timezone when being displayed
                Henrique Ferraresso

                Thanks Tom,
                I really appreciated your attention.
                I'll do some research about it, but thanks to give me a way to go.