2 Replies Latest reply: Jul 10, 2013 2:29 AM by subhashishmishra RSS

    looping files using Variables and QVS

      Hi All,

       

      i am curretnly facing an issue whicle looping through multiple excel file using variable for Path, and the variables are defined in a QVS file.

       

      When i use Code 1 and Code in QVS file - its skipping the loop and shows "Execution failed". The connection through QVS connects fine, but its not getting into the loop.

       

      CODE 1
      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      $(Include=..\..\..\Include\EMEA\EMEA_Q2C_MDF\Connection.qvs); 
      
       FOR each File in filelist ('$(vPathActivity)')                        
      CrossTable(FundName, FundData, 97)
      Activity:
        LOAD *
             FROM [$(File)] (ooxml, embedded labels);
      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      
      Code in QVS file
      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      set errorMode=0;
      OLEDB CONNECT32 TO [Provider=ADsDSOObject;Encrypt Password=False;Data Source=\\16.16.224.41\\Q2C_MDF;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648];
      
      
      let vPathFinance = '\\16.16.224.41\QV_InputFiles\Q2C_MDF\Finance\Finance.xlsx';
      let vPathActivity = '\\16.16.224.41\QV_InputFiles\Q2C_MDF\Activity\*.xlsx';
      
      if ScriptErrorCount >0 then
      let ScriptErrorCount =0;
      
       OLEDB CONNECT32 TO [Provider=ADsDSOObject;Encrypt Password=False;Data Source=\\16.17.84.41\\Q2C_MDF;Mode=Read;Bind Flags=0;ADSI Flag=-2147483648];
      
       let vPathFinance = '\\16.17.84.41\QV_InputFiles\Q2C_MDF\Finance\Finance.xlsx';
      let vPathActivity = '\\16.17.84.41\QV_InputFiles\Q2C_MDF\Activity\*.xlsx';
      
       end if
      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      If i use this code using direct path it works fine
      CODE 2
      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      FOR each File in filelist ('\\16.16.224.41\QV_Input_Files\Q2C_MDF\Activity\*.xlsx')
      CrossTable(FundName, FundData, 97)
      Activity:
        LOAD *
             FROM [$(File)] (ooxml, embedded labels);
      ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      
      
      

       

       

      Any help is very much appriciated.!!

       

      Regards,

      Subhashish