Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
MVP
MVP

Re: Changing the starting number for Autonumber()?

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

2 Replies
MVP
MVP

Re: Changing the starting number for Autonumber()?

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

Re: Changing the starting number for Autonumber()?

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