1 Reply Latest reply: May 3, 2014 1:42 PM by jagan mohan rao appala RSS

    For loop Problem

      Hi

       

      PFA

        • Re: For loop Problem
          jagan mohan rao appala

          Hi,

           

          Please find script below

           

          FOR i = 1 to Month(Today()) -1

            LET vMonthYear = Text(Date(MakeDate(Year(Today()), i), 'MMM YYYY'));

           

           

            If i = 1 then

            Data:

            LOAD organizationLookupDesc,

                corporateFunctionLookupDesc,

                employeeRootId,

                lastName,

                firstName,

                '$(vMonthYear)' AS SheetName    

            FROM

            [EMEA HEADCOUNT 2014_GMBH-Anonym.xlsx]

            (ooxml, embedded labels, table is '$(vMonthYear)');

            ELSE

            Concatenate(Data)

            LOAD organizationLookupDesc,

                corporateFunctionLookupDesc,

                employeeRootId,

                lastName,

                firstName,

                '$(vMonthYear)' AS SheetName      

            FROM

            [EMEA HEADCOUNT 2014_GMBH-Anonym.xlsx]

            (ooxml, embedded labels, table is '$(vMonthYear)');

            ENDIF

          NEXT

           

          Regards,

          Jagan.