Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
wunderch
Creator
Creator

autonumber rows

Hi guys,

I have a table like this:

IDValue

1

50
1USA
1Mark
233
2

Germany

2Chris

Now I need a table like this:

IDValueKey
1501
1USA2
1Mark3
2331
2Germany2
2Chris

3

How can I do this in script??

Thanks for your answers!

Regards

Chris

1 Solution

Accepted Solutions
sunny_talwar

May be this

LOAD ID,

     Value,

     AutoNumber(RowNo(), ID) as Key

FROM ...;

View solution in original post

7 Replies
sunny_talwar

May be this

LOAD ID,

     Value,

     AutoNumber(RowNo(), ID) as Key

FROM ...;

wunderch
Creator
Creator
Author

Thanks for your quick answer!

YoussefBelloum
Champion
Champion

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 ?

sunny_talwar

I am not just using RowNo(), but AutoNumber on top of RowNo() which will restart counting based on different IDs. Does that make sense?

YoussefBelloum
Champion
Champion

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)

sunny_talwar

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

YoussefBelloum
Champion
Champion

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).