2 Replies Latest reply: Mar 20, 2012 6:22 PM by ElianoMarques RSS

    Multiple Loops

      Hi everyone,

       

       

      Need some help here.

       

      Imagine that i load 2 tables and want to loop values from the first one in the second one, is that possible?

       

      table1:

       

      load a // String

      from ...

       

       

      table2:

      load b // Specific Date

      from...

       

      Now i want for each value of a to get all of Data values in b

       

      I thought to do something like to loops but dont know if is possible.

       

      for i = 1 noofrows(table1)

      for ii= 1 noofrows(table2)

       

      Not lucky..

       

      Can someone help me?

       

      Regards,

      EM

        • Multiple Loops
          Carlos Lisboa

          Hi EM,

           

          I believe you need only to use the exists on the where clause.

          Something like:

          table1:

           

          load a // String

          date(a,'FORMAT') as key

          from ...

           

           

          table2:

          load b // Specific Date

          b as key

          from...

          where exists(key);

           

           

           

          You need to pay attention to the date format, the key field should be in equal format.

           

          Regards,

          Carlos