1 Reply Latest reply on Nov 19, 2018 5:07 PM by Esther Aller

    Dashboard filters to use Date Filter with Date corresponding to CST and not UTC on Tableau Online

    A W

      I have a Report published on Tableau online which has hour based date time filter but since Tableau Online is in time zone UTC, when a date time filter is selected, the report reflects as per UTC timezone wherein I want it to reflect as per CST. Current Workaround: Subtracting 5 hours from the filter selected to get accurate time on filter. But I will have to change the logic wrt to Day Light Saving changes.

       

      Current Partial Logic:

       

      CASE [Time Range]

      WHEN 'Current Date' THEN

      IF  datetime([order_date]) <= DATEADD('hour',-5,NOW())

      and DATEDIFF('day',[order_date],DATEADD('hour',-5,NOW()))=0

      THEN ZN([Written Sales]) END

      END

       

      Thanks in advance,

      Akshay

        • 1. Re: Dashboard filters to use Date Filter with Date corresponding to CST and not UTC on Tableau Online
          Esther Aller

          Hi Akshay,

           

          You might want something more like this:

           

          IF DATEPART('dayofyear', TODAY() ) + DATEPART('weekday', DATETRUNC('year', TODAY() )) >= 72

          AND DATEPART('dayofyear', TODAY() ) + DATEPART('weekday', DATETRUNC('year', TODAY() )) < 308

          THEN DATEADD('hour', -5, [Date Field] )

          ELSE DATEADD('hour', -4, [Date Field] )

          END

           

          And then that field will be used in place of [Date Field]. The conditions after the IF statement will return the dates between the 2nd sunday in March and the 1st sunday in November. This does not account for leap years, so you will need to adjust the day of year numbers for those dates.

           

          Hope this answers your question