12 Replies Latest reply: Nov 8, 2018 6:13 AM by Martin Pohl RSS

    SQLTable TABLE_NAME Variable not Matching Sheet Name for Excel Load

    Alex Tomlins

      Hi Guys, What is wrong with the below script? The variable is pulling the table names from an excel sheet using SQLTables Function. The variable seems to be fine as i can see it in the Trace statement - but when i call the variable inserted into the load statement as  ' Table is '$(vTable)')' it seems as if it can't match the Variable and the sheet in Excel. In short there is a discrepancy between SQLTables table names and the excel sheet tables names because when i come to call upon the sheets in the load it cannot identify/find them.



      LIB CONNECT TO 'CRTrackerTest (924034-qlik_924034-admin)';


      unqualify *;


      TABLES:


      SQLTables;


      DATA:


      LOAD 0 as Dummy AutoGenerate 0;


      For i = 0 To NoOfRows('TABLES')


         Let vTable = Peek('TABLE_NAME', $(i), 'TABLES');

        

          Trace This is vTables Value: $(vTable);


          Concatenate(DATA)


          LOAD

         

          "CR Filename",

          Implemented as Date,

          Description,

          Requestor


          FROM [lib://ExcelSheets (924034-qlik_924034-admin)/CR Tracker.xls]


          (biff, embedded labels, Table is '$(vTable)')

          ;


      Next