2 Replies Latest reply: Jun 30, 2015 12:35 PM by Mihal Patel RSS

    loop through array to load data in qlikview

    Mihal Patel


      I am loding data in qlikview using statement

      / /Importing data from flat file
      LOAD  @1 AS CoCd,
      @2 AS Period,
      @3 AS [Doc. Date],
      @4 AS [Pstng Date],
      @5 AS TranslDate,
      @6 AS Reference,
      @7 AS DocumentNo,
      @8 AS Crcy,
      @9 AS Year,
      @10 AS [Doc. Type],
      txt, codepage is 1252, no labels, delimiter is ';', msq)


      where @10 = 'KA' or @10 = 'KG' or @10 = 'KR' or @10 = 'KH' or @10 = 'KN' or @10 ='AB' or @10 ='IK' or @10 ='IM' or @10 ='MM' or @10 ='RE' or @10 ='RN';


      this statement loads data perfectly but it is not dynamic since if I want to change the @10 to some different value I have to make change directly to the script, I am looking for a way that loop through a array containing these values and load data to the table


      something like creating variable



      $(vDocTypes) = 'KA','KG','KR','KH','KN','AB','IK','IM','MM','RE' ,'RN';

      which I can use in where clause that goes through the values in the array and load the data