1 Reply Latest reply: Oct 24, 2016 6:43 PM by Oleg Troyansky RSS

    Combining Year and Month Columns into a single Date column

    Jes Lee

      Hello,

       

      I'm trying to format my dates from the various data sources I'm getting my data from.  One data source represents the date by two separate columns (Year and Month).  I would like to combine these two columns into a single one, but also change the month format. 

       

      For instance,

       

      Year = YYYY

      Month = M01

       

      Date = JanYYYY

       

      I hope someone could help me with this.

       

       

      Thank you,

       

      Jessica

        • Re: Combining Year and Month Columns into a single Date column
          Oleg Troyansky

          Hi Jessica,

           

          your solution will include two parts:

           

          1. Build a proper date field

          2. Format the date field in the required way.

           

          In order to build the proper date field, use the MakeDate function and only use the last 2 characters of the Month:

           

          MakeDate(Year, Right(Month, 2))

           

          Then enclose the same in the formatting function Date():

           

          Date(MakeDate(Year, Right(Month, 2)), 'MMMYYYY')

           

          That will do the job.

           

          cheers,

          Oleg Troyansky

          Learn advanced QlikView and Qlik Sense techniques in my book QlikView Your Business