Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i have two columns one is ID and second is Date. My requirement is that i have to find out Row Num for each record and that i have done by RowNo() fuction but tha problem is that and the main requirement is that if the Id is changed then RowNo() again starts from 1,2,......
Help Needed Sample Data File is attached
Plz Its Urgent
Hello Kumar,
I think it is not a good idea to use autonumber for this purpose. Because that does not guarantee of sequencial number generation for large data set.
Thanks.
See the attached application.
Thanks.
Tressco could u plz explain me what this line of code do:
If(ID=peek('ID'),Peek('Count')+1,1) as Count
Tressco could u plz explain me what this line of code do:
If(ID=peek('ID'),Peek('Count')+1,1) as Count
Thanks In Advanced
ID=peek('ID') - checks if the current ID is same as the previous one loaded, if so the counter is incremented(peek('count')+1). If not so, that means the ID is a new one so the counter gets initiated as 1.
Note: assumption: your data is sorted on ID field.
Hope this helps.
Thanks.
Hi,
Find the attached File
Hello Kumar,
I think it is not a good idea to use autonumber for this purpose. Because that does not guarantee of sequencial number generation for large data set.
Thanks.
Tressco Its Not work when i fetch the dat from excel
Thanks
Hi tresesco,
Ok! Thanks for advice. Please Check now . i am currected that issue using with RowNo().
See the below script. This good one:
Taple1:
LOAD *,RowNo() as TempRowNo INLINE [
ID , Date
A1, 5/12/13 12:00 AM
A1, 5/13/13 12:00 AM
A1, 5/14/13 12:00 AM
A1, 5/15/13 12:00 AM
B2, 5/16/13 12:00 AM
B2, 5/17/13 12:00 AM
C4, 5/18/13 12:00 AM
C4, 5/19/13 12:00 AM
C4, 5/20/13 12:00 AM
D5, 5/21/13 12:00 AM
E6, 5/22/13 12:00 AM
];
New_one:
NoConcatenate LOAD ID,
Date,
AutoNumber(Date&TempRowNo,ID) as RowNo
Resident Taple1 order by ID, Date;
DROP Table Taple1;
Your application data and source data do not match. Else the output seems fine. right?