4 Replies Latest reply: Feb 25, 2015 12:06 PM by Manish Kachhia RSS

    Peek function in load script

    Christophe MANNS

      Hello,

       

      Here is a simple load :

       

      Temp:

      LOAD * INLINE [

      id, field, counter

      1, bla,0

      1, bla,0

      1, bla,0

      2, bla,0

      2, bla,0

      2, bla,0

      3, bla,0

      3, bla,0

      ];

       

       

      Temp2:

      LOAD

      id,

      field,

      IF (peek(id)<>id,1, peek(counter) + 1) AS counter2

      RESIDENT Temp

      ORDER BY id;

      drop table Temp;

       

      I try to get a counter which reset for each new id find

       

      I get only 1 for each new id, but it doesn't increment when he find 2 same id :

       

      Sans titre.png

       

      Any idea ?

       

      Thanks