Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a table with 2 ID columns ID1 and ID2.
As you can see there can be 2 ID2 for same ID1.
Column ProjectID has a numbering based on the unique ID1.
Im having trouble having a sub numbering for ID2. I don't know if I have to use peek function or a for loop.
If there are 2 ID2 for ID1, I need a new column which indicates sub rank 1,2.
If there is 1 ID2 for ID1, I need to display 1 if there are 3 ID2 grouped under ID 1, I need to have a numbering 1,2,3
Any help on this would be appreciated.
Thank you!
If you are numbering the combinations (ID1 and ID2), try like:
Autonumber(ID2, ID1) as Counter
I'm able to add a total count of the sub id, but able to to a numbering...
Or do I have to use a pick() function?
Try like:
Autonumber(Rowno(), ID1) as Counter
Edit: Corrected
Ah! i thought it nearly worked, but noit's not numbering correctly...
autonumber(ID1,ID2) as NewID
from datasource;
or
autonumber(ID2,ID1) as NewID
from datasource;
Hi Hero,
If you just need to create a new id for each ID2 grouped by ID1, you could try autonumber(ID2,'ID_Inc' & ID1) as ID2_PK
@check the file
If you are numbering the combinations (ID1 and ID2), try like:
Autonumber(ID2, ID1) as Counter