Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have a table like this:
ID | Value |
---|---|
1 | 50 |
1 | USA |
1 | Mark |
2 | 33 |
2 | Germany |
2 | Chris |
Now I need a table like this:
ID | Value | Key |
---|---|---|
1 | 50 | 1 |
1 | USA | 2 |
1 | Mark | 3 |
2 | 33 | 1 |
2 | Germany | 2 |
2 | Chris | 3 |
How can I do this in script??
Thanks for your answers!
Regards
Chris
May be this
LOAD ID,
Value,
AutoNumber(RowNo(), ID) as Key
FROM ...;
Thanks for your quick answer!
Hi sunny,
autonumber is not supposed to create unique integer value for each distinct evaluated value ?
here on every line there is new rowno() number.
can you explain how it works please ?
I am not just using RowNo(), but AutoNumber on top of RowNo() which will restart counting based on different IDs. Does that make sense?
Yes of course I read carefully what you suggested. I talk about rowno() only because rowno() is different on every line. and referering to the syntax, Autonumber created a unique integer for every value etc...
can't understand why it is restarting the counting using Rowno() and ID.. as long as every values evaluated on every line is unique.
Autonumber(1,1)
Autonumber(2,1)
Autonumber(3,1)
Autonumber(4,2)
Autonumber(5,2)
Autonumber(6,2)
Do you understand the use of the second parameter within the AutoNumber function, right? As long as the second parameter is the same in the AutoNumber it will create a continuous number, but once changed it restart the counting from 1. Autonumber will work like this....
Autonumber(1,1) = 1
Autonumber(2,1) = 2
Autonumber(3,1) = 3
Autonumber(4,2) = 1
Autonumber(5,2) = 2
Autonumber(6,2) = 3
Thank you
No, I didn't know about it.. for this one I only read the help and i didn't notice the AutoID part (which is the second parameter you're talking about).