Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
microwin88x
Creator III
Creator III

Generate Numbers from a Field

Hello,

I have the following table in script:

ACCT_IDBINARY
000547414010010
000724921400011
000858399810010
000873513810101
001055327211100

What I need is to generate a new field ID with a unique number for the BINARY field like this:

ACCT_IDBINARYID
0005474140100101
0007249214000112
0008583998100101
0008735138101013
0010553272111004

I could have repeated numbers in BINARY, so the generated number in ID should considerate this possibility.

Do you know if there's any way to do this?

Thank you!

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

You could use autonumber() for this

EX:

LOAD ACCT_ID,

     BINARY,

     AutoNumber(BINARY) as Key

FROM

[http://community.qlik.com/thread/151513]

(html, codepage is 1252, embedded labels, table is @1);

Result: 

Capture2.PNG

View solution in original post

2 Replies
german_avanzato
Creator
Creator

You should use the command

AutoNumber in the script:


AutoNumber( BINARY) as ID





JonnyPoole
Employee
Employee

You could use autonumber() for this

EX:

LOAD ACCT_ID,

     BINARY,

     AutoNumber(BINARY) as Key

FROM

[http://community.qlik.com/thread/151513]

(html, codepage is 1252, embedded labels, table is @1);

Result: 

Capture2.PNG