Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Source Table:
ITEM
A0001
A0001
A0002
A0002
A0001
A0001
A0002
A0003
A0003
Result Table:
COUNTER ITEM
1 A0001
2 A0001
3 A0001
4 A0001
1 A0002
2 A0002
3 A0002
1 A0003
2 A0003
Result Table should be sorted by ITEM then a counter from 1 to total counter per counter is created.
Thanks guys for you help.
~skip~
You can use the autonumber() function with ITEM as a grouping and a unique value. Like this
autonumber(recno(), ITEM) as COUNTER
The data doesn't even have to be sorted, unless you want the COUNTER values to be assigned in an order based on some other field.
-Rob
Hi, Try to use the recno() function it will help you.
Regards,
Nitin Jain
Does not reset to one when new ITEM is loaded.
Whenever your new data will be loaded the new record number will be generated.
But you don't worry if the some value is coming again and again it will have the same counter.
It won't change.
Regards,
Nitin Jain
When I used the RecNo() same output is generated like RowNo():
COUNTER ITEM
1 A0001
2 A0001
3 A0001
4 A0001
5 A0002
6 A0002
7 A0002
8 A0003
9 A0003
The counter is continuous. What I need is same as my example.
It should reset to one when new item is loaded.
Hi,
Try to use the Autonumber.
For ex. autonumber(ITEM) as counter
Hope this will help you.
Regards,
Nitin Jain
You can use the autonumber() function with ITEM as a grouping and a unique value. Like this
autonumber(recno(), ITEM) as COUNTER
The data doesn't even have to be sorted, unless you want the COUNTER values to be assigned in an order based on some other field.
-Rob
Thanks Rob...
Hello Rob,
Brilliant solution! You saved my day. Thanks very much.
Thomas