7 Replies Latest reply: Feb 20, 2018 10:07 AM by youssef belloum

# 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??

Regards

Chris

• ###### Re: autonumber rows

May be this

Value,

AutoNumber(RowNo(), ID) as Key

FROM ...;

• ###### Re: autonumber rows

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 ?

• ###### Re: autonumber rows

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

• ###### Re: autonumber rows

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)

• ###### Re: autonumber rows

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

• ###### Re: autonumber rows

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