6 Replies Latest reply: Mar 24, 2016 9:48 AM by Gysbert Wassenaar RSS

    Qlik Sense Script Line Error on For Loop in Version 2.2.0

    Tim Kendrick

      I have a script that used to work with previous versions and definitely worked in QlikView:


      Generic Load * Resident [Demographic Responses];
      [Demographic Information]:
      Load Distinct [Respondent ID] as [Respondent ID]
      Resident [Demographic Responses];
      FOR i = 0 to NoOfTables()
        Load TableName($(i)) as [TableName] AUTOGENERATE 1
        WHERE WildMatch (TableName($(i)), 'tmpTable.*');
      NEXT i
      FOR i = 1 to FieldValueCount('Tablename')
        LET vTable = FieldValue('Tablename', $(i));
        LEFT JOIN ('Demographic Information') LOAD * RESIDENT [$(vTable)];
        DROP TABLE [$(vTable)];
      NEXT i
      Drop Tables [Demographic Responses], TableList;


      The first For loop works, but the second does not for some reason. I assure you there is NO problem with the data in [Demographic Responses]. I've tried other types of loops and I am out of ideas. I get the following error every time:


      Qlik Sense Line Error.PNG