5 Replies Latest reply: Jun 3, 2014 12:04 PM by Francisco Cordoeiro RSS

    Script error to order the Time Dimension table

      Hi,

       

      I'm doing a simple script to order the Time Dimension table...

       

      After the reload the table DimTimeMonthly is not loaded, without the last code line "Drop Table DimTimeMonthly_Temp;",

      the table DimTimeMonthly is loaded with duplicated lines?!

       

      Provably it's a very simple code error...

       

      Thanks in advance...

       

      MonthNr:

      Mapping

      LOAD * INLINE [

          Month, MonthID

          Jan, 1

          Feb, 2

          Mar, 3

          Apr, 4

          May, 5

          Jun, 6

          Jul, 7

          Aug, 8

          Sep, 9

          Oct, 10

          Nov, 11

          Dec, 12

      ];

       

      DimTimeMonthly_Temp:

      LOAD MonthID,

           MonthName,

           Mid(MonthName,1,3) as Month,

           YearID,

           YearName as Year,

           RelativeMonthID,

           MATID,

           MATOrderID,

           MAT,

           ,ApplyMap('MonthNr',Mid(MonthName,1,3), 'NA') as MonthNr

      FROM

      ..\DataSources\$(vQVDsBeg_Name)DimTimeMonthly.qvd

      (qvd)

      where RelativeMonthID>0;

       

      DimTimeMonthly:

      LOAD *

      Resident DimTimeMonthly_Temp

      order by MonthNr;


      Drop Table DimTimeMonthly_Temp;