0 Replies Latest reply: Oct 16, 2014 9:04 AM by Marko Rakar RSS

    Using IF statement in load while using variable

    Marko Rakar

      I am trying to use IF statement in my load script and this IF statement should use variable to check if conditions are met:


      let noRows = NoOfRows('Transposed')-1;

      let vNo = 0;


      for i = 0 to $(noRows)


              let Kan = peek('Kan',$(i),'Transposed');

              let Gla = peek('Gla',$(i),'Transposed');

              let ID = peek('ID',$(i),'Transposed');


              if( $(vNo) = '0', let Li = Peek('Kan',$(i), 'Transposed'));




              '$(Kan)' as Kan,

              '$(Gla)' as Gla,

              '$(ID)' as ID,

              '$(Li)' as Li


              FROM RESIDENT Transponded;


      if (($(no)=12), let n = 0, let n=n+1);


      next i;


      Problem is in my IF statement, for some reason they do not work. Idea behind this code is to enumerate rows as a member of particular group (first 12 rows are member of same group and group name is contained in first record). After 12th record I reset my counter and begin again.


      When I enter the code as above, in my script editor I have red underlined comma and my statement does not work.


      Any ideas?