2 Replies Latest reply: Jul 27, 2011 4:30 AM by Erika Jain RSS

    For Loop

      Hi All !

      I need some help...

      I have a table ...

      in this table i have a field as 'serialNo.'  whose values are as  101,201,301,401...nd so on...

       

      Nw i want to generate a series for each of the above value.

       

      Like:

       

      For Value : 101

                        102

                        103

                        104

                        105

                        106

                        107

                         .

                         .

                         .

                        110

       

      Similarly for Value 201...

        • Re: For Loop
          Angus Monro

          Here's one way to do it:

           

          data:

           

          load *

           

          inline [serialNo

           

          ;

           

          extras:

           

          load *

           

          inline [extra

           

          ;

           

          crossjoin:

           

          load serialNo as ser

           

          Resident data;

           

          outer join

           

          load extra as X

           

          Resident extras;

           

          extendedlist:

           

          load ser+X as series

           

          resident crossjoin;

           

          drop Tables crossjoin, extras;