4 Replies Latest reply: Sep 18, 2013 8:21 AM by Philippe Grenier RSS

    ApplyMap() Degrading in variable

    Antoine Frangieh

      Hi,

       

      I am trying to create a variable that creates several ApplyMap Statements in the Load Script.

       

      In the Second Iteration, it degrades

      See below:

       

       

      LET c =Null ();
      FOR j =0 to 23

      LET c = '$(c)' & If ($(j) =0, '', ', ') & 'ApplyMap'&'('&Chr(39)&'Map_Table'&Chr(39)&','&'%Key1'&'&'&Chr(39)&'|'&Chr(39)&'&'&'[Key2]&'&Chr(39)&'|'&Chr(39)'&'&$(j)&','&'0'&')'&' as [P ($(j))]';
      NEXT j

       

       

       

      [Table 2]:

      LOAD
      *,
      $(c)

       

      Resident [Table 1] ;

       

      ApplyMap('Map_Table',%Key1&'|'&[Key2]&'|'&0,0) as [P (0)],

      ApplyMap(Map_Table,%Key1|[Key2]|1,0) as [P (1)]

       

      // the first iteration is a success.

       

      //the second (and subsequent) iteration(s) is a failure. Note how ' ' for the table name, the & and the '|' have disappeared.

       

      How I could make it behave?

       

      Thanks,


      Antoine

      PS: it falls within a series of simulation I am performing:

      http://community.qlik.com/thread/92181

      http://community.qlik.com/thread/91411