6 Replies Latest reply on Mar 9, 2019 2:04 PM by Amany Mhmd

    FAQ:  To Date Calculations



      Tutorial Video:  Date Calculations | Tableau Software

      Calculation Reference Library:  Date Functions

      Online Help:  Changing Date Levels   not a date calculation, but some beginners might not know that


      Dating Rody

      Think Data Thursday Dating Rody - YouTube

      Dating Rody 1 | Tableau Public

      Dating Rody 2 | Tableau Public



      2019-02-03 - Fun with Date Calculations: Dynamic YTD and Prior Year Comparisons by Lindsay Betzendahl



      The collections below are some of the questions which have been asked about converting to date:


      Integers to Date

      2014-04-29   Re: Help!! How to convert unix timestamp to normal date format?

      2014-04-04   String to Date

      2014-03-28   Problem with year when using Date() function on format "ddmmyy" YY before 1950 converts to after 00

      2014-03-24   Help coverting number to date....

      2014-01-22   Re: Re: Converting to a Date/Time Field

      2013-12-16   Re: How can i convert weeks number  datatype as date format?

      2013-11-20   Create a date out of columns: Day, Month, Year

      2013-11-17   how do you convert a week number (1-52) to a date

      2013-11-06   Re: Formatting dates with calculations

      2013-10-16   Re: how do you read year ("YYYY") only as a year in tableau?

      2013-09-04   How can I convert an integer or character of this format (YYYYMM) to a date format.

      2013-05-29   Re: Converting Integer to Date

      2013-04-27   DATEADD or best function to convert a data type from a number data type to a date data type

      2013-02-19   How to convert a string date to Date type?

      2013-01-23   calculated field date    double answered today 2014-05-16, otherwise ignored for 16 months

      2012-11-13   Custom SQL and Date Conversion

      2011-11-10   Error message when converting epoch time to date

      2011-11-07   Creating a MONTH measure for monthly summarized data

      2011-05-06   YYYYMM to last day of the month


      Text to Date

      2014-01-23   convert string to GMT timezone

      2013-04-28   converting yyyy.mm into date format

      2012-04-13   How can I use Date and DateAdd in a single calculation to tranform a text field to date and to convert to our fiscal calendar?

      2012-04-04   Convert to Date Format

      2009-12-03   Struggling to convert string field to date

      2008-05-01   How to convert weird "date" text string to Datetime format?


      Date to DateTime

      2014-05-14   Merge Date and Time field issue

      2013-11-20   Re: date and time


      Find more ...








      It was quite interesting for me to find and re-read  this request  for a  FAQ page:


      FAQ wish expressed.png


      Other FAQ collections:   FAQ Hub

        • 2. Re: FAQ:  To Date Calculations
          Saurabh Siroya



          I have a business requirement where I want to use the relative filter but the current date should be a user input and based on that I should be able to select Weekly, Monthly and Quarterly view. Or is there a way to create a date as an input for the user and based on that I will have a list from which I can select weekly, Monthly or a Quarterly view.


          Please help.



          Saurabh Siroya

          • 3. Re: FAQ:  To Date Calculations
            shlpa deshmukh

            Hi Guys,


            Can someone help me on this. I have one date column. i want to color the line chart using date in such a way that (maximum date - 90) should be colored in one color and rest in other.


            I am using this calculation but its not working.


            IF (ATTR([Date])=[Max Date]

            or ATTR([Date])>=DATEADD('day',-90,[Max Date]))

            THEN 'Forecast' else 'Actual' END


            Please correct me.

            • 4. Re: FAQ:  To Date Calculations
              Ayush Gaurav

              Hi all,


              I have a requirement where I have date variable. I have created a parameter to use it as a filter for Month, Day, Year, Weekday, and week. For others everything is working as per requirement. I am facing issue when selecting 'Week'.

              This is showing the numbers as 0,1,2,... and so on. But I want this to be shown as week starting date. Consider the below attached format to achieve.



              Acual Week NumberExpected date format
              WeekWeek Starting Date


              I have used below statement in calculated field to get the week and weekday(Sunday, Monday,..)

              WHEN 'Weekdate' then STR(DATEPART('week',[Date Time Nearest Hour])-1)

              WHEN 'Day Name' then STR(DATENAME('weekday',[Date Time Nearest Hour],'Sunday'))


              Please suggest what should be done to achieve my required output.

              • 5. Re: FAQ:  To Date Calculations
                Saurabh Siroya

                can you share a sample worksheet ?


                I am not sure but I can try to help you.




                • 6. Re: FAQ:  To Date Calculations
                  Amany Mhmd

                  This is great

                  thank you