2 Replies Latest reply: Oct 9, 2014 1:23 PM by anbu cheliyan RSS

    Restart autonumber count every....X

      Howdy,

       

      I'm building a dashboard to analyze the Sessions_Servername log file.

       

      I want to restart my autonumber counter every Day for each user...So each user will have X # of sessions for each day, then it will restart the next day.

       

      Sample output:

       

      User,       Date,       Autonumber(???)

      David,    1/1/2014,  1

      David     1/1/2014,  2

      David     1/1/2014,  3

      David     1/2/2014,  1

      David     1/2/2014,  2

      David     1/2/2014,  3

      David     1/2/2014,  4



      Much thanks,


      -David

        • Re: Restart autonumber count every....X
          Massimo Grossi

          RESULT

          1.png


          SCRIPT

          a:

          load User, Date inline [

          User,      Date,      Autonumber

          David,    1/1/2014,  1

          David ,    1/1/2014,  2

          David ,    1/1/2014,  3

          David ,    1/2/2014,  1

          David ,    1/2/2014,  2

          David ,    1/2/2014,  3

          David ,    1/2/2014,  4

          Simon,    1/1/2014,  1

          Simon ,    1/1/2014,  2

          Simon ,    1/1/2014,  3

          Simon ,    1/2/2014,  1

          Simon ,    1/2/2014,  2

          Simon ,    1/2/2014,  3

          Simon ,    1/2/2014,  4

          ];

           

          b:

          NoConcatenate

          load *,

          if(User<>peek(User) or Date<>Peek(Date), 1, peek(id)+1) as id

          Resident a

          order by User, Date;

           

          DROP Table a;

          • Re: Restart autonumber count every....X
            anbu cheliyan

            Load *,AutoNumber(RecNo(),Date) Inline [

            User,Date

            David,1/1/2014

            David,1/1/2014

            David,1/1/2014

            David,1/2/2014

            David,1/2/2014

            David,1/2/2014

            David,1/2/2014 ];