2 Replies Latest reply on Aug 16, 2018 5:29 AM by Mahfooj Khan

    Date-Time field to Month.

    Ankit Patel

        Hey, I am new to Tableau, have a question. How to Convert these date and time field to Month Only?

       

      30.01.2018 08:59
      26.01.2018 07:04
      30.01.2018 08:55
      25.01.2018 02:54
      28.01.2018 16:11
      31.01.2018 01:40
      10.01.2018 05:21
      10.01.2018 11:11
      24.01.2018 04:34
      21.01.2018 02:06
      31.01.2018 12:19
      20.01.2018 12:13

      23.01.2018 11:07

       

      Thanks.

        • 1. Re: Date-Time field to Month.
          Jim Dehner

          good morning

          this will return the month number

          the the month name

           

           

          Jim

          If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

          1 of 1 people found this helpful
          • 2. Re: Date-Time field to Month.
            Mahfooj Khan

            Hi,

             

            There are several ways to get the month from a date field. Seeing the data it seems string values. You've to first convert these values to datetime then you can easily get the month name out of that.

            If your datetime field contains string values then below is my approach,

             

            Create a calculated field like this

             

            DATEPARSE("dd.MM.yyyy hh:ss",[Datetime]) //It will convert the string into date and time. "dd.MM.yyyy hh:ss" set the format as per your requirement.

             

            DATENAME('month',DATEPARSE("dd.MM.yyyy hh:ss",[Datetime])) //It will fetch the month name from that string

             

            Let us know if this help.

             

            Mahfooj

            1 of 1 people found this helpful