3 Replies Latest reply: Aug 7, 2015 2:38 AM by Matthew von Brockdorff RSS

    Problem with assigning a numberic ID to YearWeek using AutoNumber()

    Matthew von Brockdorff

      Hi,

       

      I am trying to assign each of the YearWeek a new numeric ID using the Autonumber() function in the script, as shown below:

       

      [Master Calendar]:
      LOAD *,
        AutoNumber(YearWeek, 'YearWeekID') as [YearWeekID]
        ;
      LOAD Timekey as Date, 
           Year, 
           Month, 
           WeekMethode, 
           Week, 
           WeekDay, 
           Day, 
           YearWeek, 
           YearMonth, 
           YearQuarter, 
           Quarter, 
           Period, 
           PeriodWeek, 
           FiscalWeek, 
           FiscalQuarter, 
           FiscalYear
           
      FROM
      .
      

       

      After I created a temporary table box with the YearWeekID and YearWeek field to test whether the script is working as expect. However to my surprise I got the following result:

       

      Capture.PNG Capture 2.PNG

       

      Shouldn't the calender be populated in ascending order in such a way that each new YearWeek will have a YearWeekID value that is the consecutive to its previous period?

       

      Any help would be appricated