4 Replies Latest reply: Jun 11, 2011 5:11 AM by sunil jain RSS

    Week extract from date field ?



      Please find attached the excel file.


      I have DATE field. I need to create PERIOD and WEEK (52 weeks) dimensions. Can someone tell me the logic?


      Many thanks

        • Week extract from date field ?

          Can anyone help me please ?


          Many thanks

            • Week extract from date field ?



              I think you'd be best creating a basic calendar in your QV document.  If you check the QlikView example docs loaded I think there is one there already, if not I'll dig out an example from here.


              You basically build a calendar from a min to max date, for each date in that you define a week number:

              WEEK(date) as WEEK


              Then I would suggest an inline load (something like the below).  Alternatively do the inline load before as a mapping load an map the period field into the calendar as you build it.


              LOAD * INLINE [

                  WEEK, PERIOD

                  1, P1

                  2, P1

                  3, P1

                  4, P1

                  5, P2

                  6, P2

                  7, P2

                  8, P2

                  9, P3



              I hope that helps.