Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Changing the starting number for Autonumber()?

Hi guys!

I am facing the need to have my data's rather random collection of IDs in a sequencial manner and thought I'd use the autonumber() function. However, I need the sequencial numbering to start from 0. Is it possible to change the starting value of Autonumber()? Or do I need to do a "Autonumber() -1" so to say?

All the best

//Nathalie

1 Solution

Accepted Solutions
sunny_talwar

I think AutoNumber() - 1 would be the only option... but what is your concern with AutoNumber() - 1? Also, AutoNumber tends to be slow and I have seen people mentioning that Peek()/Previous() give better performance....

View solution in original post

3 Replies
sunny_talwar

I think AutoNumber() - 1 would be the only option... but what is your concern with AutoNumber() - 1? Also, AutoNumber tends to be slow and I have seen people mentioning that Peek()/Previous() give better performance....

Not applicable
Author

Thanks, Sunny. 😃
As with many thinks in Qlik I was: 1. concerned about potential pitfalls in doing so and 2. thought that maybe there was a smarter way, i.e. built-in attributes to add to other functions.

Autonumber()-1 did the trick.

Have a great day

Marius_
Contributor III
Contributor III

Autonumber(RowNo(), [Field]) as Rownum cannot be used twice in the load script. It works the first time, but after that. No!