Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
RESULT
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;
RESULT
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;
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 ];