4 Replies Latest reply: Jun 29, 2016 5:08 AM by Manish Kachhia RSS

    Loop with variable. but the loop keeps running

    Joris Lansdaal

      Hi All,

      I use a loop together with a variable VarRow. The table conains 5 rows and VarRow =5. But When I run below script (part of) the loops just keeps on going.

      Any tips?


           Load Max(Rows) as MaxRow
           Resident Tmp_Agreements1;


      Set VarRow = MaxRow;


      For I =0 to VarRow

      distinct Productgroep as Bonus_Productgroep ,
      Peek('Agree_End_Date',$(I),'Tmp_Agreements1') as Agree_End_Date ,
      Peek('Agree_Start_Date',$(I),'Tmp_Agreements1') as Agree_Start_Date ,
      Peek('Bonus_Hoofdorganisatie',$(I),'Tmp_Agreements1')as Bonus_Hoofdorganisatie,
      Peek('Bonus_Abs',$(I),'Tmp_Agreements1')as Bonus_Abs,
      Peek('Bonus_%',$(I),'Tmp_Agreements1')as Bonus_%,
      Peek('Bonus_Base',$(I),'Tmp_Agreements1') as Bonus_Base,
      Peek('Bonus_Artnr',$(I),'Tmp_Agreements1') as Bonus_Artnr,
      Peek('Agreement_Description',$(I),'Tmp_Agreements1')as Agreement_Description,
      Peek('Overeenkomst',$(I),'Tmp_Agreements1')as Overeenkomst
      Resident Sales_Lines ;
      Next I