7 Replies Latest reply: Nov 4, 2016 7:37 AM by Ravi Kancharla RSS

    Peek function issue

    scotly victor

      Hi Every one ,

       

      My Input date

       

      id,date

      1,1/2/2016

      1,6/2/2016

      1,7/2/2016

      1,11/2/2016

      1,13/2/2016

      1,16/2/2016

      1,21/2/2016

      ];

       

      Desired Output:

       

      id,Startdate,Enddate

      1,1/2/2016,6/2/2016

      1,6/2/2016,7/2/2016

      1,7/2/2016,11/2/2016

      1,11/2/2016,13/2/2016

      1,13/2/2016,16/2/2016

      1,16/2/2016,21/2/2016

      1,21/2/2016,4/11/2016

      ];

       

      My Script:

      load

      date as Startdate,

      id,

      if(peek(id,1)=id,peek(date,1),today()) as Enddate

      RESIDENT Date1 order by id ,date ;