10 Replies Latest reply: Apr 10, 2017 4:53 AM by Shivani Singhal RSS

    Can we use autogenerate and resident simultaneously?

    Shivani Singhal

      Table:

      LOAD * INLINE

      [

      Claim_No,Transaction_No,Paid_Date,Outstanding

      123,1,1/1/17,20000

      123,2,3/2/17,19000

      456,3,3/1/17,15000

      456,4,5/2/17,13000

      123,5,8/10/17,10000

      456,6,10/11/17,5000

      ];

       

       

       

       

      Table1:

      LOAD *,

           min(Paid_Date) AS Start,

        today() AS End

           RESIDENT Table;

           AUTOGENERATE 1;   // I'm getting an error here.

          

       

       

       

       

      Concatenate(Table)

      Table2:

      LOAD *,

        if(iterno()=1,Start,floor(monthstart(addmonths(Start,iterno()-1)))) AS From,

        rangemin(floor(monthend(if(iterno()=1,Start,floor(monthstart(addmonths(Start,iterno()-1)))))),End) AS To,

        iterno() AS Line

      RESIDENT Table1

      WHILE monthstart(addmonths(Start,iterno()-1))<=End;

      DROP TABLE Table1;