0 Replies Latest reply: Oct 26, 2016 6:49 AM by Rahul Krishan Goyal RSS

    For next loop not working

    Rahul Krishan Goyal

      Hello Everyone,


      I am trying to use For next loop in a Load Statement on a resident table A. But, it generates numerous rows,  while the resident table has only 900 rows.


      Please help me in resolving the same ASAP.


      I am trying with the following script;


      set session=0;

      FOR i = 0 TO NoOfRows('A_final_one')




      f_tgt as ff_tgt,

      f_source as ff_source,

      f_SSID as ff_SSID,

      f_rssi as ff_rssi,

      f_imp_day as ff_imp_day,

      f_imp_date as ff_imp_date,

      f_imp_time as ff_imp_time,

      f_imp_year as ff_imp_year,

      ff_time as fff_time,

      $(session) as row_cnt,

      if (ff_time > 6,1,0) as return_cust,

      even(rowno()) as row_no,

      if(even(rowno())=-1 and (f_source = previous(f_source)and f_imp_date = previous(f_imp_date)),

      ((((second(f_imp_time - previous(f_imp_time)))/60) + (minute(f_imp_time - previous(f_imp_time)))

        +(hour(f_imp_time - previous(f_imp_time)))*60)),0) as recwise_time,

        second(f_imp_time - previous(f_imp_time))/60 as sec,

        minute(f_imp_time - previous(f_imp_time)) as mints,

        Hour(f_imp_time - previous(f_imp_time))*60 as hrs

      order by f_source,f_imp_date,f_imp_time;

      set session=$(session)+1;

      next i;