Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

AutoNumber or AutoID

Hello All,

In my current script I have a field that contains data with a leading alpha character followed by six digit number. I have been tasked to create a new ID by using the leading alpha character and then generating a sequential set of ID numbers.. For example I have the numbers D123456, D123457, D123458 and so on. I want to isolate all the ID numbers with a D and recreate an ID number keeping the leading alpha character. Basically, I would like to use AutoNumber or AutoID to create a whole new number with the leading letter. The same would apply for the other ID numbers in this field. ex. C123456, C123457, C123459, N123456, N123457. I would like to repeat this for every type of ID number. Would appreciate if anyone could provide some insight on how I could possibly generate these ID's. Thank you in advance.

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: AutoNumber or AutoID

Maybe like

LOAD ID, Left(ID,1) & Autonumber(ID, Left(ID,1)) as newID

INLINE [

ID

D123456

D123457

D123458

C123456

C123457

C123459

N123456

N123457

];

You may need to sort your input table if you need your newID appropriately increasing with old ID number value.

View solution in original post

1 Reply
Highlighted
MVP
MVP

Re: AutoNumber or AutoID

Maybe like

LOAD ID, Left(ID,1) & Autonumber(ID, Left(ID,1)) as newID

INLINE [

ID

D123456

D123457

D123458

C123456

C123457

C123459

N123456

N123457

];

You may need to sort your input table if you need your newID appropriately increasing with old ID number value.

View solution in original post