1 Reply Latest reply: Oct 4, 2013 3:41 AM by Fabrice Aunez RSS

    loop, concatenate and exist function together

    Harleen Singh

      How to use Exist function inside loop?

       

      my question is when we do loop we cannot drop the table because i need to concatenate all things of loop together.

       

      But i want exit function should work on each and every table created in the loop separately.

       

      If you look at code below i cannot drop table hence exits function will not work for each table separately.

       

       

       

      
      

      or j=2012 to 2012

      for i=1 to 3

       

       

      customerloop:

      LOAD

      ID as ID1,

      EntryType,

      INVOICEACCOUNT,

      MonthName,

      DATAAREAID1 as DATAAREAID,

      MetricID

      Resident

      Customer

      where Year(MonthName)=$(j) and Month(MonthName)=$(i);

       

       

      Concatenate

       

       

      LOAD

        1 as ID1,

           0 as EntryType,    

           4 as MetricID,

           MonthName(Date('01/$(i)/$(j)')) as MonthName,

           Upper(text(ID)) as DATAAREAID

       

       

         //  NAME as Company

          

      FROM

      MasterCompanies;

      where not Exists(DATAAREAID,ID) and [ISVIRTUAL]=0 and ID<>'0000';

       

      NEXT i;

      NEXT j;