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

Autonumber() in Incremental Loads

We are trying to use autonumber() with incremental loads. On the initial load, we have the field with the autonumber() working fine.

AutonumberField1
1A
2B
3C
4D

However, we want to keep the autonumber() continuing on subsequent incremental loads from where it last left off; so it would start the next with 5. Is this possible with the autonumber() function?

1 Solution

Accepted Solutions
sunny_talwar

Are you doing a autonumber on Field1? If yes then you can try the following:

I have not tried it, but what if you create a variable, lets say vCount

count:

LOAD Count(AutoNumber) as AutoNumberCount

Resident yourTable;

LET vCount = Peek('AutoNumberCount')

and then in your incremental load do AutoNumber(Field1) +$(vCount) as AutoNumber, but do this on a resident load table with a where condition specifying Where not Exists(Field1).

Again, I have not tested this, but I feel a variation of this should work for you.

Best,

Sunny

View solution in original post

1 Reply
sunny_talwar

Are you doing a autonumber on Field1? If yes then you can try the following:

I have not tried it, but what if you create a variable, lets say vCount

count:

LOAD Count(AutoNumber) as AutoNumberCount

Resident yourTable;

LET vCount = Peek('AutoNumberCount')

and then in your incremental load do AutoNumber(Field1) +$(vCount) as AutoNumber, but do this on a resident load table with a where condition specifying Where not Exists(Field1).

Again, I have not tested this, but I feel a variation of this should work for you.

Best,

Sunny